Statement
Use conditional compilation statements to create variables.
@set @varname = term
Parameters
VarName
Required option. A valid JScript variable name. You must always place a "@" character in front of you.
Term
Required option. 0 or more unary operators, followed by a constant, conditional-compilation variable, or an expression enclosed in parentheses.
Description
Conditional compilation supports numbers and Boolean variables. String not supported. Variables created with @set are usually used in conditional compilation statements, but can also be used anywhere in JScript code.
The example of a variable declaration looks as follows:
@set @myvar1 = 12@set @myvar2 = (@myvar1 * 20)@set @myvar3 = @_jscript_version
The following operators are supported in an expression enclosed in parentheses:
- ! ~
- * / %
- + -
- << >> >>>
- < <= > >=
- == != === !==
- & ^ |
- && | |
If the variable is used before the variable is defined, its value is NaN. NaN can be checked with @if statement:
@if (@newVar != @newVar)
...
This succeeds because NaN is not equal to its own unique value.
Requirements
Version 3
Please see
Conditional Compilation | conditional Compilation Variables | @cc_on Statement | @if Statement