SET Function

Sets values for items within an array. The returned value is the old value of the specified element in the array.

Category: Array
Returned data type: Integer

Syntax

array name.SET(<n,"string">)

Required Argument

array name

is the name of the array that you declared earlier in the process.

Optional Arguments

n

is the number of the dimension that you are setting the value for; this can be specified as a numeric constant, field name, or expression.

"string"

is the value that you want to place into the array element; this can be specified as a string constant, field name, or expression.

Details

The SET function sets the value of an entry in the array.

Examples

Example 1

// Declare the string array "string_list"
// Set the dimension of string_list array to 5
string array string_list
string_list.dim(5)
 
// Set the first string element in the array to "Hello"
string_list.set(1,"Hello")

Example 2

string array string_list
string_list.dim(5)
// sets the first string element in the array to hello
string_list.set(1,"hello")