You are here

Clear Variable in NSIS

2 posts / 0 new
Last post
3D1T0R
3D1T0R's picture
Offline
Last seen: 3 years 4 months ago
Developer
Joined: 2006-12-29 23:48
Clear Variable in NSIS

i must be missing something important in NSIS Var command.
Var
[/GLOBAL] var_name
Declare a user variable. Allowed characters for variables names: [a-z][A-Z][0-9] and '_'. All defined variables are global, even if defined in a section or a function. To make this clear, variables defined in a section or a function must use the /GLOBAL flag. The /GLOBAL flag is not required outside of sections and functions.

Var example

Function testVar
Var /GLOBAL example2

StrCpy $example "example value"
StrCpy $example2 "another example value"
FunctionEnd

but i cant make it clear the variable
ive tried Var /GLOBAL 1
ive tried Var /GLOBAL $1
ive tried alot of things and i just dont understand it

could anyone help me?
Please???

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 15 years 1 month ago
Joined: 2006-01-06 21:27
Easy
Var example
Var example2
Function testVar
StrCpy $example "example value"
StrCpy $example2 "another example value"
StrCpy $example "" ;This clears the variable.
FunctionEnd

You forgot to declare example2 BTW.
----
Ryan McCue
Current Fav. Songs:

  • Ballroom Blitz - The Misfits
  • Manic Monday - Cyndi Lauper
  • I Don't Like Mondays - The Boomtown Rats

"If you're not part of the solution, you're part of the precipitate."

Log in or register to post comments