Jump to content

Set Variable - More than once in the same script?


This topic is 3583 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Is it possible to use the set variable script step more than once in the same script?

 

I'm firstly using it to determine the number of pages in a report header ( 1 of 4, 2 of 4 etc) and then I want to use it again further down the script to name and save the report as pdf.

 

If there isn't a way to do this in the same script are there any other ways please?

Link to comment
Share on other sites

Is it possible to use the set variable script step more than once in the same script?

 

As many as you like. Note that if you use the step again with the same variable name and repetition, you will modify the existing variable's value. Otherwise you will create a new, independent variable.

  • Like 1
Link to comment
Share on other sites

Thanks Comment, the variables were named differently. The issue was that after the first variable was used to determine the number of pages on the report, I had a pause/resume script step. Clicking continue undid the work that the variable had undertaken, that led to my original question regarding using mutliple set variable steps in the same script. Removing the pause/resume script step solved the problem.

Link to comment
Share on other sites

Clicking continue undid the work that the variable had undertaken

 

Not sure what that means. A variable does not undertake any work; it holds a value for you. In the case of a script $variable, it will hold it until the script exits, regardless of any intervening pauses. In the case of a global $$variable, it will hold it until you close the file.

Link to comment
Share on other sites

Not sure what that means. A variable does not undertake any work

 

Sorry, that's just my loose terminology.

Link to comment
Share on other sites

Terminology aside, the point is that pausing the script should not affect your variables. If it does, then you have a problem unrelated to anything discussed so far. Removing the pause script step may have removed the problem, or merely hidden it.

Link to comment
Share on other sites

Terminology aside, the point is that pausing the script should not affect your variables. If it does, then you have a problem unrelated to anything discussed so far. Removing the pause script step may have removed the problem, or merely hidden it.

 

Removing the pause script step did solve the problem. Based on your reply stating that it shouldn't have any effect, I reinstated the pause script step and this time it worked just fine.

Link to comment
Share on other sites

This topic is 3583 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.