Difference between revisions of "CATable::SetDataByLabels"
(Marked this version for translation) |
|||
Line 3: | Line 3: | ||
<languages /> | <languages /> | ||
<translate> | <translate> | ||
− | = [[CATable]]::SetDataByLabels(x,indexLabels) = | + | = [[CATable]]::SetDataByLabels(x,indexLabels) = <!--T:1--> |
+ | <!--T:2--> | ||
Sets the value of an input table cell at the coordinate «indexLabels» to the value «x». «IndexLabels» specifies the label for each index of the table in order. | Sets the value of an input table cell at the coordinate «indexLabels» to the value «x». «IndexLabels» specifies the label for each index of the table in order. | ||
+ | <!--T:3--> | ||
The «indexLabels» parameter specifies the coordinates of a cell in the table, using the index labels ([[CATable::SetDataByElements]] does the same using index position). When the table is one dimensional, «indexLabels» can be a single value -- a text value when the index is a list-of-labels, or a number when the index is a numeric list. Otherwise, «indexLabels» must be an array with ''N'' elements when the table is ''N''-dimensional. | The «indexLabels» parameter specifies the coordinates of a cell in the table, using the index labels ([[CATable::SetDataByElements]] does the same using index position). When the table is one dimensional, «indexLabels» can be a single value -- a text value when the index is a list-of-labels, or a number when the index is a numeric list. Otherwise, «indexLabels» must be an array with ''N'' elements when the table is ''N''-dimensional. | ||
+ | <!--T:4--> | ||
The order of the dimensions, as they are listed in «indexLabels», is determined by a previous call to [[CATable::SetIndexOrder]]. | The order of the dimensions, as they are listed in «indexLabels», is determined by a previous call to [[CATable::SetIndexOrder]]. | ||
+ | <!--T:5--> | ||
The return value is a Boolean value indicating success (true) or failure (false). | The return value is a Boolean value indicating success (true) or failure (false). | ||
+ | <!--T:6--> | ||
When the result table is zero-dimensional (i.e., atomic, not an array), you must use [[CATable::AtomicValue]] to access the value. | When the result table is zero-dimensional (i.e., atomic, not an array), you must use [[CATable::AtomicValue]] to access the value. | ||
− | = Examples = | + | = Examples = <!--T:7--> |
− | == In VB == | + | == In VB == <!--T:8--> |
− | dim editTab as CATable = var2d.DefTable | + | <!--T:9--> |
+ | dim editTab as CATable = var2d.DefTable | ||
− | dim indexLabs(1) ' Contains two elements, (0) and (1) | + | <!--T:10--> |
+ | dim indexLabs(1) ' Contains two elements, (0) and (1) | ||
indexLabs(0) = 3 | indexLabs(0) = 3 | ||
indexLabs(1) = "green" | indexLabs(1) = "green" | ||
Line 28: | Line 35: | ||
ET = editTab.GetDataByLabels(indexLabs) | ET = editTab.GetDataByLabels(indexLabs) | ||
− | dim resTab as CATable = var2d.ResultTable | + | <!--T:11--> |
+ | dim resTab as CATable = var2d.ResultTable | ||
resTab.SetIndexOrder( Split("I,J",",")) | resTab.SetIndexOrder( Split("I,J",",")) | ||
RT = resultTab.GetDataByLabels(indexLabs) | RT = resultTab.GetDataByLabels(indexLabs) | ||
− | RT1 = var1d.ResultTable.GetDataByLabels("red") | + | <!--T:12--> |
+ | RT1 = var1d.ResultTable.GetDataByLabels("red") | ||
− | = Error Codes = | + | = Error Codes = <!--T:13--> |
+ | <!--T:14--> | ||
: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 43: | Line 53: | ||
:30 – “Position does not exist” | :30 – “Position does not exist” | ||
− | = See Also = | + | = See Also = <!--T:15--> |
+ | <!--T:16--> | ||
* [[CATable::SetIndexOrder]] | * [[CATable::SetIndexOrder]] | ||
* [[CATable::RenderingStyle]] and [[CARenderingStyle]] | * [[CATable::RenderingStyle]] and [[CARenderingStyle]] |
Latest revision as of 01:13, 16 June 2015
ADE User Guide > ADE Server Class Reference > CATable
CATable::SetDataByLabels(x,indexLabels)
Sets the value of an input table cell at the coordinate «indexLabels» to the value «x». «IndexLabels» specifies the label for each index of the table in order.
The «indexLabels» parameter specifies the coordinates of a cell in the table, using the index labels (CATable::SetDataByElements does the same using index position). When the table is one dimensional, «indexLabels» can be a single value -- a text value when the index is a list-of-labels, or a number when the index is a numeric list. Otherwise, «indexLabels» must be an array with N elements when the table is N-dimensional.
The order of the dimensions, as they are listed in «indexLabels», is determined by a previous call to CATable::SetIndexOrder.
The return value is a Boolean value indicating success (true) or failure (false).
When the result table is zero-dimensional (i.e., atomic, not an array), you must use CATable::AtomicValue to access the value.
Examples
In VB
dim editTab as CATable = var2d.DefTable
dim indexLabs(1) ' Contains two elements, (0) and (1) indexLabs(0) = 3 indexLabs(1) = "green" editTab.SetIndexOrder( Split("I,J",",") ) ET = editTab.GetDataByLabels(indexLabs)
dim resTab as CATable = var2d.ResultTable resTab.SetIndexOrder( Split("I,J",",")) RT = resultTab.GetDataByLabels(indexLabs)
RT1 = var1d.ResultTable.GetDataByLabels("red")
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