|
Variables:
Variable is a reserved space of memory to allocate a value that we can use with a previously declared name,
after this, we can change its value.
To declare variables you must use Declare command:
Syntax:
Declare Variable.Type
|
Example:
Declare Value1.l, Value2.b, ValueX.w
|
After declare a variable, you must use variables without type extension,
if you use Declare variable.b to use after declare it, you must use this variable without .b
extension, this affects to Local and arrays variables.
Types:
.b | Byte |
.w | Word |
.l | Long |
.f | Float |
.s | String |
Local variables:
Local variable is a variable that only can be changed or use it on its enviroment, on ScriptVM these environments
are the main program, and inside procedures, you can declare local variables with the same name on different
environments.
To declare a local variable on main program or inside a procedure use Local command.
It have same syntax that Declare.
Syntax:
Local Variable.Type
Arrays variables:
Arrays are groups of variables allocated on memory that can be used using a index to determinate the variable value,
it can have up to 16 dimensions, but the most used are one and two dimensional arrays. To declare an array you must
use Dim command.
Syntax:
Dim Array.Type(Dimensions)
|
Example:
Dim Array.l(10, 5)
|
Array types:
.b | Byte |
.w | Word |
.l | Long |
.f | Float |
To set a value:
Array(1, 1) = 100
To get a value, or use as parameter:
test = Array(1, 1)
Add(test, Array(5, 2))
|
|