Dennis.Matl Posted April 24, 2015 Share Posted April 24, 2015 I am formatting a label for USPS mailing I need to put in the OEL information with some of our information at the beginning of the line. 123456 M1 FF************************ADC 605 {Memcode}{Memtype}{Magname}variable number of *{endorse} The Memcode can vary from 3-7 characters and Memytpe can be 0-3, and Magname is always 2 characters I know that I will need to calculate the length of the string: memcode+memtype+magname+endorse=x and the length of the maximum string (text box is 4.0in wide) = y y-x=total number of * i need And then insert that value into the padL function I have been able to get by with the built-in simple rules until now. But I am stumped. Thanks in advance for any help or direction Dennis Matl Production Manager American Nuclear Society Quote Link to comment Share on other sites More sharing options...
step Posted April 24, 2015 Share Posted April 24, 2015 (edited) If I'm understanding your question correctly and you want to dynamically add asterisks between the "Magname" and the "Endorse" variables, then you don't need a rule for this at all. In you text editor, insert your first 3 variables, tab, and insert the "endorse" variable. Then click the "Tabs..." button in the text editor dialog box and add a new tab: Position: 3.9in (Note: if the line has to be exactly 4 inches long, set the position to 4 and increase the width of the text box so it doesn't wrap.) Alignment: Right Leader: * If you really wanted to do this with JavaScript, you could use TextMeasure to measure the length of your 4 variables and using a while loop add an asterisk to that string until the line was equal to 28800 (4 inches - TextMeasure returns width in 1/100 of a point). But I think that's unnecessary. Edited April 24, 2015 by step Clarification Quote Link to comment Share on other sites More sharing options...
Dennis.Matl Posted April 24, 2015 Author Share Posted April 24, 2015 Thanks. That worked perfect. I knew there was a simple way, just couldn't figure it out. Dennis Matl Production Manager American Nuclear Society Quote Link to comment Share on other sites More sharing options...
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.