EXTRACT

EXTRACT


EXP Index Level FIELD
Syntax EXTRACT( dynamic.array.expression, ac.expression )
EXTRACT( dynamic.array.expression, ac.expression, vc.expression )
EXTRACT( dynamic.array.expression, ac.expression, vc.expression, sc.expression )

Alternate method, using dynamic array reference symbols:

dynamic.array.variable<ac.expression>
dynamic.array.variable<ac.expression, vc.expression>
dynamic.array.variable<ac.expression, vc.expression, ...
... sc.expression>
Category BASIC
Type Function
Description retrieves a specific attribute, value, or subvalue from a dimensioned or dynamic array.

"extract" makes a copy of an element in a dynamic array rather than physically removing the element.  The original syntax of the "extract" function is equally as valid as the dynamic array reference method.
Options
See Also statements & functions array.variable ac.expression REPLACE INSERT LOCATE dimensioned array WRITE dynamic array array references READ vc.expression DEL assignment functions sc.expression
Example print extract(customer.item,1,0,0)
print extract(customer.item,1)     
print customer.item<1>  

All of these examples retrieve the entire first attribute from the dynamic array, "customer.item".

print extract(customer.item(1),1,2)
print customer.item(1)<1,2>

Both of these examples retrieve the second value from the first attribute of the dynamic array, "customer.item".

name = extract(customer.item(1),1,1)
name = customer.item(1)<1,1>

Both of these examples assign the variable "name" to the first value from the first attribute of the array "customer.item".
Warnings An extract of attribute 0 is undefined and should be avoided.
Compatibility D3 7.0 AP R83
EXP Index Level FIELD