Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Set Variable - More than once in the same script?

Featured Replies

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?

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.

  • Author

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.

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.

  • Author

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

 

Sorry, that's just my loose terminology.

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.

  • Author

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.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.