hi ! when we used script parameter Usually؟
See this help topic for example usage of Script Parameter:
Sent from miPhone
thanks , but now i want just kbow about script parameter and learning videos on youtube & blogs is very bad
Whenever you are specifying a script to perform, you have the option of specifying a script parameter. This is information which you pass to the script and can use within the script itself; the parameter could be a piece of text, a number, or a calculation, for example.
A typical use case would be a script that could be used in more than one way, e.g. to navigate to the previous record or the next record. You could specify a script parameter on one button as "back" and on another button as "forward", assign the same script to each button, and then the script will navigate accordingly. Perhaps that simple example will give you some idea.
here's a simple example of sending and receiving script parameters ...
One cause of confusion is that FMP only allows "one" script parameter. Thus, if you have a script where you'd like to pass more than one value, you need to resort to "special tricks". That's a bad design in my view which should have been remedied many versions ago.
In real programming languages you can pass very complicated types (both literal and reference) to a function/method, but, fortunately in FMP, you don't need to worry about that distinction. FMP makes life as easy as possible.
HOPE THIS HELPS.
here is another simple use of script parameters
say you have 2 buttons on a layout, 1 to print the layout and the other to Preview the layout
both buttons will run the same script "print/preview report"
- for the print button, when you choose the script to run, you add "Print" to the optional script parameter field at the bottom of the "Specify Script" dialog window
- for the preview button, when you choose the script to run, you add "Preview" to the optional script parameter field at the bottom of the "Specify Script" dialog window
Now when you write the script "print/preview report",
- you add an IF to the script that allows you to choose between print or preview
- the script will run one button or the other,
- if the script is run without the parameter (nothing will happen)
allow User Abort [off]
if (get script parameter = "Print")
go to report layout
if (get script parameter = "Preview")
enter preview mode
go to [original layout]
Thanks for a very good explanation. I have also been a little confused on script parameters.
Retrieving data ...