Update cookies preferences
Promotic

SetCellValue - method of the PmaDataTable object

Description:
Sets the value of the table cell.
Syntax:
Empty SetCellValue(Variant Row, Variant Col, Variant Value, [String sParams])
Parameters:
Row(Variant) Specifies the cell row in the table either by index (number) or by the identifier of the row (text string, the 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 identifier of the column (text string, the 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.
Value(Variant) The new value to be written.
sParams[optional] (String) Specifies the behavior of the method in more detail. Entries are in the KeyVal format, for example "row:id;".
row (optional) - Specifies the meaning of the parameter Row.
id - The Row parameter will always represent the identifier of the row (also as number).
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 0 value 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 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.SetCellValue(0, 0, 3.14);
oDataTable.SetCellValue(0, -2, oDataTable.GetCellValue(0, -2) +1);
oDataTable.SetCellValue(-3, 7, 0);

History:
Pm9.00.25: New sParams parameter. Specifies the behavior of the method in more detail.
Pm9.00.00: Created
PROMOTIC 9.0.28 SCADA system documentation MICROSYS, spol. s r.o.

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