Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Item - property of object PmaDataTable

Description:
The property returns/sets the value of the table cell.
Syntax:
Variant Item(Variant Row, Variant Col)
Calling:
Reading the value:
val = oDataTable.Item(row, col)
Writing the value:
oDataTable.Item(row, col) = val
Parameters:
Row(Variant) Specifies the cell row in the table either by index (Long or Integer data type) or by the row identifikator (String data type, case sensitive text).
If is >=0, then it is the row index (zero-based index).
If is -2, then it means the last row.
If is -3, then sets the value in all rows of the selected column.
 
Caution! Row identifier can be used only if the first column of the table is of the data type Identifier.
Col(Variant) Specifies the cell column in the table either by index (Long or Integer data type) or by the name (String data type, case sensitive text).
If is >=0, then it is the column index (zero-based index).
If is -2, then it means the last column.
If is -3, then sets the value in all columns of the selected row.
Note:
Property access for read and write.

The value of this property can be also obtained in the INFO system in "PmaRoot" item (when looking into the object with this property). This property can be changed in the INFO system by clicking the "Actions" button. See "PmaRoot > Permissions > InfoEdit" permission.

 
"Read only" columns: Each cell is empty at the beginning. The cell is considered empty also if it contains numeric value 0 or an empty 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.
Example1:
In the "/Data/Params" object (of the PmaDataTable type) the following operations are carried out:
- the value 3.14 is set into the 1. row and 1.column
- the value 1 is added to the 1. row and the last column
- the whole 8. column is zeroized
JavaScriptVBScriptSelect and copy to clipboard

var oDataTable = pMe.Pm("/Data/Params1");
oDataTable.Item(0, 0) = 3.14;
oDataTable.Item(0, -1) = oDataTable.Item(0, -1) +1;
oDataTable.Item(-3, 7) = 0;
Example2:
Reading value from table cell from row on the index and column on the index into variable v1 and reading value from cell located on row named temperature and in column named value into variable v1.
JavaScriptVBScriptSelect and copy to clipboard

var oDataTable = pMe.Pm("/Data/Params1");
var v1 = oDataTable.Item(0, 0);
var v2 = oDataTable.Item("temperature", "value");
PROMOTIC 9.0.7 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