SetItem - method of the PmArray object
Description:
Sets the value in the item defined by indexes i and j.
Syntax:
Empty SetItem(Variant vValue, Long i, [Long j])
Parameters:
vValue | (Variant) Value |
i | (Long) Array index (zero-based index). |
j | [optional] (Long) Array index (zero-based index).
In case of the 1-dimensional array the parameter is not used or its value is -1. |
---|
Note:
This method is also functional in
Web panels.
The value can be set only to the item that exists in the array (the items are created by the
Create method).
If the array needs to be bigger then instead of using the
SetItem method, call the
Insert method.
Example1:
1-dimensional array
JavaScriptSelect and copy to clipboard
var arr = Pm.CreatePmArray(1, 3);
arr.SetItem("Test0", 0);
arr.SetItem("Test1", 1);
// ...
Example2:
2-dimensional array
JavaScriptSelect and copy to clipboard
var arr = Pm.CreatePmArray(2, 3, 5);
arr.SetItem("Test", 0, 2);
// ...
var val = arr.GetItem(0, 2);
// val = Test