PDA

View Full Version : Passing value to scripts



Doug I
05-01-2005, 06:09 PM
I was told you can pass a value to a script and then use this value in a variable. Can I see an example snippet of code that demonstrates the commands used for doing this.

I think it is the #def command, but I'm not sure where to place it exactly, and an example script would go a long way in understanding this.

Thanks.

linder
05-02-2005, 12:41 AM
Doug,

Let us assume, you have the following in your script. The %MYVAR% variable is set to 0 and if you execute the script the Message Box displays 0.

Set Variable %MYVAR% to 0
Message Box "%MYVAR%" -- "Test"

But if you start your executable with the following command line, it will display "cool" instead of "0".

yourinstallername.exe /V MYVAR cool

The above sets %MYVAR% to cool (please do not add the %-sign around the variable name).

Does this help?