sirius.onyx
7th October 2003 14:46 UTC
Var question
Hi,
I tried to make a local variable with the following code,
but the compiler turns out an error, that it's an invalid
command. (input: Var inst_comment)
I tried to look up whether this keyword is deprecated or
not but did'nt find any sign of it.
Can anyone please help me?
Thanks, in advance
kichik
7th October 2003 14:58 UTC
Var can not create local variables, only global. You must also define the variable before you use it.
Afrow UK
7th October 2003 16:44 UTC
I was thinking, it would be nice if you could use...
Var MyVar "Hello Jim!"
...where "Hello Jim!" would be $MyVar's starting value.
-Stu
kichik
7th October 2003 16:56 UTC
Just copy something into it in .onInit. This would be possible when compiler plug-ins are implemented, hopefully in 2.1.
sirius.onyx
8th October 2003 13:49 UTC
Hi,
thanks for the reply but I think I didn't describe my problem
well. :( My problem is that the following example does not compile:
Var $labelstr
Section
detailprint $labelstr
SectionEnd
Function .onInit
StrCpy labelstr "text"
FunctionEnd
The version I'm using is: MakeNSIS v2.0b3
The error message is the following:
---
Processing script file: "C:\TEMP\var_test.nsi"
Invalid command: Var
Error in script "C:\TEMP\var_test.nsi" on line 1 -- aborting creation process
---
I tried it many ways but as far as I know it should work.
Is there any other way to specify a variable?
regards,
sirius.onyx
kichik
8th October 2003 13:53 UTC
Var is not present in b3 and prior versions. It's only present in the latest CVS version. See the development page on the NSIS homepage (find a link in my signature) for more information about obtaining the latest CVS version.
n0On3
8th October 2003 14:47 UTC
also, you define vars with "Var labelstr" not with "Var $labelstr"