Line 2: |
Line 2: |
| | | |
| As explained in the [[Variables]] section, variables are divided into '''2 categories''' and '''4 types'''. Whatever category or type, their value/content is never reset and remains, even after device reboot. They are identified by a '''name''' given at creation time ''(see below)'' | | As explained in the [[Variables]] section, variables are divided into '''2 categories''' and '''4 types'''. Whatever category or type, their value/content is never reset and remains, even after device reboot. They are identified by a '''name''' given at creation time ''(see below)'' |
− |
| |
| | | |
| '''Naming:''' | | '''Naming:''' |
Line 12: |
Line 11: |
| | | |
| Every variable can be either '''local''' or '''global'''. | | Every variable can be either '''local''' or '''global'''. |
− | * A '''local variable''' belongs to the macro it has been created into. It can only be used inside this macro. Its name must be unique inside the macro it belongs to | + | * A '''local variable''' belongs to the macro it has been created into. It can only be used inside this macro. Its name must be unique inside the macro it belongs to. |
| * A '''global variable''' can be accessed and used from any macro. Its name must be unique among all the 'global' variables | | * A '''global variable''' can be accessed and used from any macro. Its name must be unique among all the 'global' variables |
| | | |
Line 21: |
Line 20: |
| *'''Boolean''' type allows 2 states: True or False | | *'''Boolean''' type allows 2 states: True or False |
| *'''Integer''' type is to store positive or negative numbers without decimal part, in order to make any kind of mathematical calculations or comparison | | *'''Integer''' type is to store positive or negative numbers without decimal part, in order to make any kind of mathematical calculations or comparison |
− | *'''Decimal''' type is to store any positive or negative numeric value, with or without decimal digits, in order to make any kind of mathematical calculations or comparison | + | *'''Decimal''' type is to store any positive or negative numeric value, with or without decimal digits, in order to make any kind of mathematical calculations or comparison. Sientific notation may be used: 0.0012 or 1.2E-3 |
| *'''String''' type contains any kind of character (alphanumeric ones or any special ones, such as line feed/carriage return/new line or emojis). ''HINT: an individual string variable can hold up to 500,000 characters, however it is advisable to avoid very long strings where possible. If you should use strings of great length it is recommended to clear them when finished with.'' | | *'''String''' type contains any kind of character (alphanumeric ones or any special ones, such as line feed/carriage return/new line or emojis). ''HINT: an individual string variable can hold up to 500,000 characters, however it is advisable to avoid very long strings where possible. If you should use strings of great length it is recommended to clear them when finished with.'' |
| | | |
Line 37: |
Line 36: |
| | | |
| '''For Numeric variables (Integer or Decimal):''' | | '''For Numeric variables (Integer or Decimal):''' |
− | * fixed value | + | * fixed value (including any available [[Magic text]]) |
| * random value | | * random value |
| * prompt at execution time | | * prompt at execution time |
Line 44: |
Line 43: |
| * in addition, Integer type variables have 2 other kinds of settings: adding or subtracting 1 to current value (same as mathematical expression 'my_integer_variable +/- 1' but more convenient when incrementing/decrementing an index by step of 1) | | * in addition, Integer type variables have 2 other kinds of settings: adding or subtracting 1 to current value (same as mathematical expression 'my_integer_variable +/- 1' but more convenient when incrementing/decrementing an index by step of 1) |
| | | |
− | | + | In expressions, booleans have value 1 if true, 0 if false. |
− | in expressions, booleans have value 1 if true, 0 if false
| + | Beyond the mathematical operations listed in the dropdown menu usual arithmetic operators (+ - * /) can be use and |
− | and beyond usual arithmetic operators (+ - * /) you can use
| |
| :- % for modulo | | :- % for modulo |
− | :- ** for power | + | :- ^ for power |
− | :- logical operators (&& for "and", || for "or") where the operands can be booleans or numbers (0 is false, any non-zero is true) and the boolean result is converted to number (there is no "not" operator but there is a not() function shown in the list of available functions) | + | :- logical operators (&& for "and", || for "or") where the operands can be booleans or numbers (0 is false, any non-zero is true) and the boolean result is converted to number (there is no "not" operator but there is a not() function shown in the list of available functions) |
− | :- comparisons between numbers (<= < == != > >=) where again the boolean result is converted to number | + | :- comparisons between numbers (< = != >) where again the boolean result is converted to number |
| | | |
| | | |