Difference between revisions of "CATable::SetDataByElements"
(Created page with "<< Back to CATable = CATable::SetDataByElements(x,indexPositions) = Sets the value of an input table cell at the coordinate «indexPositions» to a new value «...") |
(Marked this version for translation) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | [[ | + | [[Category:ADE User Guide]] |
− | + | [[ADE User Guide]] > [[ADE Server Class Reference]] > [[CATable]] | |
− | = [[CATable]]::SetDataByElements(x,indexPositions) = | + | <languages /> |
+ | <translate> | ||
+ | = [[CATable]]::SetDataByElements(x,indexPositions) = <!--T:1--> | ||
+ | <!--T:2--> | ||
Sets the value of an input table cell at the coordinate «indexPositions» to a new value «x». «IndexPositions» specifies the 1-based position along each index of the table in order. | Sets the value of an input table cell at the coordinate «indexPositions» to a new value «x». «IndexPositions» specifies the 1-based position along each index of the table in order. | ||
+ | <!--T:3--> | ||
The «indexPositions» parameter specifies the coordinates of a cell in the table, using the position along the index, with position 1 being the first element([[CATable::SetDataByLabels]] does the same using index labels). When the table is one dimensional, «indexPositions» must be a single interger value. Otherwise, «indexPositions» must be an array with ''N'' numbers when the table is ''N''-dimensional. | The «indexPositions» parameter specifies the coordinates of a cell in the table, using the position along the index, with position 1 being the first element([[CATable::SetDataByLabels]] does the same using index labels). When the table is one dimensional, «indexPositions» must be a single interger value. Otherwise, «indexPositions» must be an array with ''N'' numbers when the table is ''N''-dimensional. | ||
+ | <!--T:4--> | ||
The order of the dimensions, as they are listed in «indexPositions», is determined by a previous call to [[CATable::SetIndexOrder]]. | The order of the dimensions, as they are listed in «indexPositions», is determined by a previous call to [[CATable::SetIndexOrder]]. | ||
+ | <!--T:5--> | ||
The return value is a Boolean indicating success (true) or failure (false). | The return value is a Boolean indicating success (true) or failure (false). | ||
− | = Examples = | + | = Examples = <!--T:6--> |
− | == In VB == | + | == In VB == <!--T:7--> |
− | dim editTab as CATable = var2d.DefTable | + | <!--T:8--> |
+ | dim editTab as CATable = var2d.DefTable | ||
− | dim coord(1) ' Contains two elements, (0) and (1) | + | <!--T:9--> |
+ | dim coord(1) ' Contains two elements, (0) and (1) | ||
coord(0) = 3 | coord(0) = 3 | ||
coord(1) = 2 | coord(1) = 2 | ||
Line 24: | Line 32: | ||
ET = editTab.GetDataByElements(coord) | ET = editTab.GetDataByElements(coord) | ||
− | dim resTab as CATable = var2d.ResultTable | + | <!--T:10--> |
+ | dim resTab as CATable = var2d.ResultTable | ||
resTab.SetIndexOrder( Split("I,J",",")) | resTab.SetIndexOrder( Split("I,J",",")) | ||
RT = resultTab.GetDataByElements(coord) | RT = resultTab.GetDataByElements(coord) | ||
− | RT1 = var1d.ResultTable.GetDataByElements(4) | + | <!--T:11--> |
+ | RT1 = var1d.ResultTable.GetDataByElements(4) | ||
− | = Error Codes = | + | = Error Codes = <!--T:12--> |
+ | <!--T:13--> | ||
:24 – “Subscripts must be an array of variants” | :24 – “Subscripts must be an array of variants” | ||
:25 – “Subscripts cannot be accessed” | :25 – “Subscripts cannot be accessed” | ||
Line 39: | Line 50: | ||
:30 – “Position does not exist” | :30 – “Position does not exist” | ||
− | = See Also = | + | = See Also = <!--T:14--> |
+ | <!--T:15--> | ||
* [[CATable::SetIndexOrder]] | * [[CATable::SetIndexOrder]] | ||
* [[CATable::RenderingStyle]] and [[CARenderingStyle]] | * [[CATable::RenderingStyle]] and [[CARenderingStyle]] | ||
Line 48: | Line 60: | ||
* [[CATable::GetDataByLabels]] and [[CATable::SetDataByLabels]] | * [[CATable::GetDataByLabels]] and [[CATable::SetDataByLabels]] | ||
* [[CATable::Subscript]] and [[CATable::Slice]] | * [[CATable::Subscript]] and [[CATable::Slice]] | ||
+ | </translate> |
Latest revision as of 01:12, 16 June 2015
ADE User Guide > ADE Server Class Reference > CATable
CATable::SetDataByElements(x,indexPositions)
Sets the value of an input table cell at the coordinate «indexPositions» to a new value «x». «IndexPositions» specifies the 1-based position along each index of the table in order.
The «indexPositions» parameter specifies the coordinates of a cell in the table, using the position along the index, with position 1 being the first element(CATable::SetDataByLabels does the same using index labels). When the table is one dimensional, «indexPositions» must be a single interger value. Otherwise, «indexPositions» must be an array with N numbers when the table is N-dimensional.
The order of the dimensions, as they are listed in «indexPositions», is determined by a previous call to CATable::SetIndexOrder.
The return value is a Boolean indicating success (true) or failure (false).
Examples
In VB
dim editTab as CATable = var2d.DefTable
dim coord(1) ' Contains two elements, (0) and (1) coord(0) = 3 coord(1) = 2 editTab.SetIndexOrder( Split("I,J",",") ) ET = editTab.GetDataByElements(coord)
dim resTab as CATable = var2d.ResultTable resTab.SetIndexOrder( Split("I,J",",")) RT = resultTab.GetDataByElements(coord)
RT1 = var1d.ResultTable.GetDataByElements(4)
Error Codes
- 24 – “Subscripts must be an array of variants”
- 25 – “Subscripts cannot be accessed”
- 26 – “Lower bound of subscript array inaccessible”
- 27 – “Upper bound of subscript array inaccessible”
- 28 – “Must specify at least one element in table”
- 30 – “Position does not exist”
Enable comment auto-refresher