SLW210 Posted March 1, 2012 Posted March 1, 2012 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. Quote
ScribbleJ Posted March 1, 2012 Posted March 1, 2012 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")) Quote
SLW210 Posted March 1, 2012 Author Posted March 1, 2012 I figured it out finally. This gives the first 8 places of the layout tab. X-XX-XXX $(substr,$(getvar,ctab),1, Quote
ScribbleJ Posted March 1, 2012 Posted March 1, 2012 Good work! Do a little dance! Cheers to you. Thanks for sharing. Quote
SLW210 Posted March 1, 2012 Author Posted March 1, 2012 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. Quote $(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. Quote
ScribbleJ Posted March 2, 2012 Posted March 2, 2012 You're quite welcome. Thanks for explaining in a bit more detail about those strings. I was curious. Quote
Recommended Posts
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.