SiMX Help‎ > ‎The Target Platform‎ > ‎Objects‎ > ‎Value‎ > ‎

value.SetAt


Platform Objects


Description

Sets an array's element value by an index. Expands an array as needed.


Syntax


Function SetAt(index, val)


Parameters


index (input) - the index where you want to set a value
val (input) - the value to set


Return value


tells if it is an array or not


Example

Sample code

UserVar.SetAt 0, "string1"  ' a new array with a single element is created
UserVar.SetAt 2, "string3"  ' an array is expended, it has 3 elements now
UserVar.SetAt 1, "string2"  ' sets a second element of an array to string2
See also

Platform Objects and Methods
value.GetAt
value.IsEmpty
Value Object
value.UBound