SetVar

Purpose:

Assign a value to a variable.

Category:

Variables

Syntax:

SetVar [var name] "value"

var name

Variable to store the value.

value

Value to be stored. Use quotes to store a string and do not use them to store a numeric value.

Example:

SetVar [myvar1] "Hello!"
SetVar [age] 34


DeleteVar

Purpose:

Remove a variable from memory.

Category:

Variables

Syntax:

DeleteVar [var name]
var name

Variable to delete.

Example:

DeleteVar [myvar]


SetCompVar

Purpose:

Assign a value to a composed variable.
A composed variable is a variable whose name is composed from a fixed part and a variable part.

Category:

Variables

Syntax:

SetCompVar [varName1[varName2]] "value"

varName1

First part of the composed variable name.

varName2

Second part of the composed variable name.

value

Value to be stored. Use quotes to store a string and do not use them to store a numeric value.

Example:

SetVar [num] "1"

SetCompVar [myvar[num]] "Hi! It works"

AlertBox "Variable value:" "[myvar1]" ""


GetCompVar

Purpose:

Get the value from a composed variable and assign it to a regular one.
A composed variable is a variable whose name is composed from a fixed part and a variable part.

Category:

Variables

Syntax:

GetCompVar [result var] [varName1[varName2]]

result var

Variable to store the result.

varName1

First part of the composed variable name.

varName2

Second part of the composed variable name.

Example:

SetVar [num] "1"

SetCompVar [myvar[num]] "Hi! It works"

GetCompVar [result] [myvar[num]]

AlertBox "Variable value:" "[result]" ""


IsVarEmpty

Purpose:

Test variable to determine if it contains a value. Returns true or false.

Category:

Variables

Syntax:

IsVarEmpty [var name] [result var]

var name

Variable to test.

result var

Variable to store the result.

Example:

IsVarEmpty [myvar] [resultvar]


TypeOf

Purpose:

Find the type of a JavaScript variable (string,number,boolean...)

Category:

Variables

Syntax:

TypeOf [var name] [result var]
var name

Variable to get it's type.

result var

Variable to store the result.

Example:

TypeOf [var name] [result var]


Watch

Purpose:

Monitor a variable and execute a subroutine whenever its content changes. Use CancelWatch to stop monitoring.

Category:

Variables

Syntax:

Watch [var name] "subroutine"

var name

Variable to wath for changes.

subroutine

Subroutine name to execute each time the variable changes its value.

Example:

Watch [myvar] "checkChanges"


CancelWatch

Purpose:

Stop monitoring a variable for changes.

Category:

Variables

Syntax:

CancelWatch [var name]

var name

Variable to stop wathing for changes.

Example:

CancelWatch [myvar]


CreateArray

Purpose:

Create a new array variable using the supplied content. Separate array elements with line breaks or commas.

Category:

Variables

Syntax:

CreateArray [array name] value1,value2,value3

array name

Variable array name to store the values.

value1,value2,value3...

Items to store in the array separated by comma.

Example:

CreateArray [colors] red,blue,orange,brown,white


CreateEmptyArray

Purpose:

Create an empty Array variable.

Category:

Variables

Syntax:

CreateEmptyArray [array name]

array name

Variable array name.

Example:

CreateEmptyArray [myarray]


ArrayLen

Purpose:

Calculate the number of items in an array.

Category:

Variables

Syntax:

ArrayLen [array name] [result var]

array name

Variable array name.

result name

Variable to store the result number.

Example:

ArrayLen [myarray] [numberOfItems]


ArrayAddItem

Purpose:

Add a new item to an array.

Category:

Variables

Syntax:

ArrayAddItem [array name] "item text"

array name

Variable array name.

item text

Text to add to the array (or number without quotes).

Example:

ArrayAddItem [mycolors] "blue"

ArrayAddItem [mynumbers] 34


ArrayDelItem

Purpose:

Remove an item from an array.

Category:

Variables

Syntax:

ArrayDelItem [array name] indexNumber

array name

Variable array name.

indexNumber

Item number to delete.

Example:

ArrayDelItem [myarray] 3


ArrayAlphaSort

Purpose:

Sort an array alphabetically.

Category:

Variables

Syntax:

ArrayAlphaSort [array name]

array name

Variable array name.

Example:

ArrayAlphaSort [myarray]


ArrayNumSort

Purpose:

Sort an array numerically.

Category:

Variables

Syntax:

ArrayNumSort [array name]

array name

Variable array name.

Example:

ArrayNumSort [myarray]


ArrayReverse

Purpose:

Reverse the order of items in an array.

Category:

Variables

Syntax:

ArrayReverse [array name]

array name

Variable array name.

Example:

ArrayReverse [myarray]


ArraySuffle

Purpose:

Randomize (suffle) an array.

Category:

Variables

Syntax:

ArraySuffle [array1 name] [array2 name]

array1 name

Array to suffle.

array2 name

Destination array.

Example:

ArraySuffle [myarray1] [myNewArray]



ArrayCombine

Purpose:

Combine the contents of two arrays into a single new array.

Category:

Variables

Syntax:

ArrayCombine [array1 name] [array2 name] [new array name]

array1 name

First array name.

array2 name

Second array name.

new array name

New array name to combine the previous two arrays.

Example:

ArrayCombine [myarray1] [myarray2] [myNewArray]


ArrayCopy

Purpose:

Create a new array using a portion of an existing array.

Category:

Variables

Syntax:

ArrayCopy [array name] indexNum numberOfItems [new array name]

array name

Variable array name.

indexNum

Index of first array item.

numberOfItems

Number of items to copy.

new array name

New array name to copy the selected items.

Example:

ArrayCopy [myarray] 3 5 [newarray]


ArraySearch

Purpose:

Find the first matching item in an array. Returns the index number of the found item or -1 if no match is found.

Category:

Variables

Syntax:

ArraySearch [array name] "value" [result var]

array name

Variable array name.

value

Item to find.

result var

Variable to store result.

Example:

ArraySearch [myarray] "blue" [colorPosition]