kiwiora Posted September 6, 2009 Posted September 6, 2009 I have a number of help layouts. They have graphical components so am unable to create them as simple text fields/records, rather there are a number of individually numbered layouts with the various help screens. All of the help screens are named HELP_#. I will be adding to them at anytime. Each one can be individually opened via the ? on screen with a go to layout (HELP_ + get(scriptparameter)) I am trying to create a script that will dynamically loop through all of the help layouts and print/append them to a pdf. Everything is working fine, with the exception that the go to layout step will not work. The calculation works fine (i.e HELP_02 should be the next layout) but the blimmen thing just won't go there : Here is my script so far Go To Layout Help01 Set Variable $$filename Set Field [gcounter right(get(layoutname);2) + 1] Save records as PDF $$filename Loop Go to Layout "Help_" & if (gcounter < "10"; "0"; "") & gcounter **this pads the number with a 0 if less than 10** Exit Loop if "Help_" & if (gcounter < "10"; "0"; "") & gcounter <> get(layoutname) save records as pdf [color:red]*appended[/color] set field gcounter right(get(layoutname); 2 + 1) End Loop I've also tried variations of getasnumber/getastext with no help : So essentially the script needs to HELP_01 *print HELP_02 *print HELP_03 *print and so on, until the next number e.g HELP_04 doesn't exist so the script exits. TIA
comment Posted September 7, 2009 Posted September 7, 2009 Try: Go to Layout [ “HELP_01” ] Save Records as PDF [] Loop Exit Loop If [ IsEmpty ( FilterValues ( SerialIncrement ( Get ( LayoutName ) ; 1 ) ; LayoutNames ( Get (FileName) ) ) ) ] Go to Layout [ SerialIncrement ( Get ( LayoutName ) ; 1 ) ] Save Records as PDF [] End Loop Go to Layout [ original layout ]
kiwiora Posted September 7, 2009 Author Posted September 7, 2009 That worked beautifully. Thanks so much. Didn't know serialincrement existed. Cheers
Recommended Posts
This topic is 5557 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now