Page 1 of 1
Goto Label Explanation
Posted: Fri Jul 27, 2012 10:34 pm
by jdeleon7010
Hello, I am new to Installaware and need to understand Goto Label. When calling a label, does the script perform every command after the label once called? for example, ill label a routine where i find the file version and name it "filever". 100 lines later, i'll call the label "filever", will it execute 100 lines again and loop?
Re: Goto Label Explanation
Posted: Mon Jul 30, 2012 4:54 am
by FrancescoT
Dear user,
the Goto statement unconditionally transfers the script execution directly to another label statement.
Exactly as it happens with any development language.
Of course if subsequently you have another Goto to the same Label, it can generate a loop.
Regards
Re: Goto Label Explanation
Posted: Mon Jul 30, 2012 9:27 am
by jdeleon7010
Thanks for the response, maybe you can help me with this logic.
I am trying to label a routine within an IF statement, but obviously IA cannot have labels within a conditional check. What would be the best way around this?
I am reading a file, I need to read the file until I find specific text that refers to a dynamic value, then pass the value into a variable.
Re: Goto Label Explanation
Posted: Mon Jul 30, 2012 9:33 am
by jdeleon7010
Also a resposne to your comment, is there a way to break out of a label and continue where the call was made?
Re: Goto Label Explanation
Posted: Mon Jul 30, 2012 10:08 am
by FrancescoT
Dear user,
I suggest you to use a custom script instead of a label.
Just create a new script and place with this, all the specific code that you need to acquire data from a file.
You could use a While statement conditionally to read through the file as:
Code: Select all
while Variable MYVAR Equals FALSE loop
Comment: PLACE YOUR CODE HERE
wend
From the main script call your custom script with:
Hope this helps you.
Regards