Promotic

Item - property of the PmaDataTable object

Description:
The property returns or sets the value of the table cell.
This property is obsolete (but functional) and it is better to use the GetCellValue method and SetCellValue.
Syntax:
Variant Item(Variant Row, Variant Col)
Parameters:
Row(Variant) Specifies the cell row in the table either by index (number) or by the row identifikator (text string, first character must be a letter, 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 Identifier data type.
Col(Variant) Specifies the cell column in the table either by index (number) or by the identifikator of the column (text string, first character must be a letter, 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 "PmaRoot" item of the INFO system (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:
JavaScriptVBScriptSelect and copy to clipboard

var val = oDataTable.Item(0, -1);   // Reading the value
oDataTable.Item(0, 0) = 3.14;   // Writing the value
Example2:
In the /DataTable object (of the PmaDataTable type) the following operations are carried out:
- the 3.14 value is set into the 1.row and 1.column
- the 1 value 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("/DataTable");
oDataTable.Item(0, 0) = 3.14;
oDataTable.Item(0, -1) = oDataTable.Item(0, -1) +1;
oDataTable.Item(-3, 7) = 0;
Example3:
Reading value of the cell from row on the index and column on the index into the v1 variable and reading value of the cell located on row named temperature and in column named value into the v1 variable.
JavaScriptVBScriptSelect and copy to clipboard

var oDataTable = pMe.Pm("/DataTable");
var v1 = oDataTable.Item(0, 0);
var v2 = oDataTable.Item("temperature", "value");

History:
Pm8.03.15: The first column can now be defined as Identifier type.
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.