Difference between revisions of "CATable::Slice"
(Marked this version for translation) |
|||
Line 3: | Line 3: | ||
<languages /> | <languages /> | ||
<translate> | <translate> | ||
− | = Slice(indexObj, n) = | + | = Slice(indexObj, n) = <!--T:1--> |
+ | <!--T:2--> | ||
Returns the nth slice of the table over index «indexObj». The result is a new [[CATable]] object with | Returns the nth slice of the table over index «indexObj». The result is a new [[CATable]] object with | ||
one fewer dimensions than the table to which it is applied. When used on a [[CAObject::DefTable|DefTable]], the sliced [[CAObject::DefTable|DefTable]] acts as a [[SubTable]], changing elements in the slice of the original table. | one fewer dimensions than the table to which it is applied. When used on a [[CAObject::DefTable|DefTable]], the sliced [[CAObject::DefTable|DefTable]] acts as a [[SubTable]], changing elements in the slice of the original table. | ||
− | = Parameters = | + | = Parameters = <!--T:3--> |
+ | <!--T:4--> | ||
;indexObj: CAObject | ;indexObj: CAObject | ||
;n: Integer – the 1-based slice position along index | ;n: Integer – the 1-based slice position along index | ||
− | =Return value = | + | =Return value = <!--T:5--> |
+ | <!--T:6--> | ||
[[CATable]] | [[CATable]] | ||
− | = Example Usage = | + | = Example Usage = <!--T:7--> |
− | CATable tab = obj.[[CAEngine::ResultTable|ResultTable]]; | + | <!--T:8--> |
+ | CATable tab = obj.[[CAEngine::ResultTable|ResultTable]]; | ||
CAIndex in1 = tab.[[CATable::GetIndexObject|GetIndexObject]]("In1"); | CAIndex in1 = tab.[[CATable::GetIndexObject|GetIndexObject]]("In1"); | ||
CATable subTab = obj.Slice(in1,1) | CATable subTab = obj.Slice(in1,1) | ||
− | = Remarks = | + | = Remarks = <!--T:9--> |
+ | <!--T:10--> | ||
The use of [[CATable::Slice]](..) on a DefTable, acting as a [[SubTable]], was introduced in 4.2.3. | The use of [[CATable::Slice]](..) on a DefTable, acting as a [[SubTable]], was introduced in 4.2.3. | ||
+ | <!--T:11--> | ||
When applied to a 1-D table, a 0-D table result, which is a non-array containing only one [[CATable::AtomicValue|atomic value]]. At that point, the [[CATable::AtomicValue]] method is used to access the value. | When applied to a 1-D table, a 0-D table result, which is a non-array containing only one [[CATable::AtomicValue|atomic value]]. At that point, the [[CATable::AtomicValue]] method is used to access the value. | ||
− | = See Also = | + | = See Also = <!--T:12--> |
+ | <!--T:13--> | ||
* [[CATable::Subscript]] | * [[CATable::Subscript]] | ||
* [[CATable::AtomicValue]] | * [[CATable::AtomicValue]] | ||
</translate> | </translate> |
Latest revision as of 01:15, 16 June 2015
ADE User Guide > ADE Server Class Reference > CATable
Slice(indexObj, n)
Returns the nth slice of the table over index «indexObj». The result is a new CATable object with one fewer dimensions than the table to which it is applied. When used on a DefTable, the sliced DefTable acts as a SubTable, changing elements in the slice of the original table.
Parameters
- indexObj
- CAObject
- n
- Integer – the 1-based slice position along index
Return value
Example Usage
CATable tab = obj.ResultTable; CAIndex in1 = tab.GetIndexObject("In1"); CATable subTab = obj.Slice(in1,1)
Remarks
The use of CATable::Slice(..) on a DefTable, acting as a SubTable, was introduced in 4.2.3.
When applied to a 1-D table, a 0-D table result, which is a non-array containing only one atomic value. At that point, the CATable::AtomicValue method is used to access the value.
See Also
Comments
Enable comment auto-refresher