Promotic
WikipediaLinkedInYoutubeTwitterFacebook

SetCellValue - method of the PmaDataTable object

Description:
Sets the value of the table cell.
Syntax:
Empty SetCellValue(Variant Row, Variant Col, Variant Value)
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 Identifier data type.
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.
Value(Variant) The new value to be written.
Note:

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.
See also:
Example1:
Writing the value 0 into a table cell with row on the index 0 and column on the index 0 into the v1 variable and also into cell located in row named temperature and in column named value.
JavaScriptVBScriptSelect and copy to clipboard

var oDataTable = pMe.Pm("/DataTable");
oDataTable.SetCellValue(0, 0, 0);
oDataTable.SetCellValue("temperature", "value", 0);
Example2:
In the /DataTable 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("/DataTable");
oDataTable.SetCellValue(0, 0, 3.14);
oDataTable.SetCellValue(0, -2, oDataTable.GetCellValue(0, -2) +1);
oDataTable.SetCellValue(-3, 7, 0);

History:
Pm9.00.00: Created
PROMOTIC 9.0.13 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