Jump to content

CTAB in Field


Recommended Posts

I want to point a field to my layout tab, but all I need in the field is the first few letters/numbers (i.e. X-XX-XXX) whereas the layout tab has much more info. I have done this in the past, but right now I am drawing a blank. :ouch:

Link to comment
Share on other sites

Maybe this will help jog you're memory or help push you (gently of course) in the right direction.

 

I'm not very familiar with diesel but I do know that the code below will at least fill in what is in the tab. Maybe there is a variable to sort only the part you need to use.

 

$(upper,$(getvar,"ctab"))

Link to comment
Share on other sites

I figured it out finally. This gives the first 8 places of the layout tab. X-XX-XXX

 

$(substr,$(getvar,ctab),1,

Link to comment
Share on other sites

Thank you for helping as well.

 

I been busy, but I should break it down, so others can adapt. The 1 is to start at the first character and the 8 is length, so the 1,8 is to display the first eight characters of, in this case, the CTAB $(getvar, ctab).

 

In ScribbleJ's example the upper will display the results in UPPERCASE

 

I found this to help me along.

 

$(SUBSTR,string,start,length) Returns the substring of string starting at character start and extending for length characters. Characters in the string are numbered from 1. If length is omitted, the entire remaining length of the string is returned.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...