Var » History » Version 1
Per Amundsen, 02/28/2014 01:02 PM
1 | 1 | Per Amundsen | _Added in 1.8.8_ |
---|---|---|---|
2 | |||
3 | */var [-sg] <%var> [[= ]value]* |
||
4 | |||
5 | Sets the value of local variable %var to the specified value. |
||
6 | |||
7 | *Switches* |
||
8 | |||
9 | -s - Display variable assignment value. |
||
10 | -g - Creates a global variable instead. |
||
11 | |||
12 | *Parameters* |
||
13 | |||
14 | <%var> - The variable to set. |
||
15 | [[= ]value] - Value to set the variable to. (can be a single arithmetic expression, see [[Arithmetic Operators]]) |
||
16 | |||
17 | *Example* |
||
18 | |||
19 | alias example { |
||
20 | var %result = 1, %x = $1 |
||
21 | while (%x) { |
||
22 | var %result = %result * $v1 |
||
23 | dec %x |
||
24 | } |
||
25 | return %result |
||
26 | } |