SetArray - method of object PmDataTable

Assignment of an array of values (of the Array type) to the data items of the object
SetArray(sType As String, index As Variant, aArray As Array) As Boolean
oDataTable.SetArray sType, index, aArray
sType(String) Type of selected values in the table:
"Row" - One row of the table is selected (i.e. must be 1-dimensional array). The value index must be an integer.

index>=0 means the index of the selected row (zero-based index).

index=-2 means the last row.

"Col" - One column of the table is selected (i.e. must be 1-dimensional array). The value index must be a String type or an integer.

If it is the String, then it is the column name.

If it is the integer, then index>=0 means the index of the selected column (zero-based index), index=-2 means the last column.

"All" - All table is selected (i.e. must be 2-dimensional array). The value index must be set to the value Empty.
index(Variant) Index to the table whose meaning is defined by the sType parameter
aArray(Array) Array of values created for example by the GetArray method or by the VBScript function Array.
Return Values:
true - assignment of values proceeded successfully
false - Otherwise
This method only assigns values to existing items in the table - thus for example the insertion of a new row is not performed.

If the number of items of the assigned array doesn't equal the number of selected items, then only those items that can be assigned, are assigned. The assignment always proceeds from the beginning (e.g. from the first item of the row) and if the array is "small", then not all items have to be assigned (e.g. nothing is assigned into the last items of the row).

"Read only" columns: Each cell is empty at the beginning. The cell is considered empty also if it contains numeric value 0 or an emty string "". New value can be written into such cell. After writing a non-zero value into the "Read only" column the cell is "locked". "Locked cell" becomes a constant and cannot be written again. Other still "unlocked" cells can be written into as needed. Methods that write into multiple cells simultaneously will write the values only into "unlocked cells" while the content of "locked" cells remains unchanged.

Last row of the table is set by the content of the arr array
VBScriptSelect and copy to clipboard

Dim arr
arr = Array("Param1", 1, 2.5, 4)
oDataTable.SetArray "Row", -2, arr
PROMOTIC 8.3.30 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice