basic.extract Function/BASIC Program

basic.extract

Command basic.extract Function/BASIC Program
Applicable release versions: AP, R83
Category BASIC Program (486)
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.
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>
Options
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".
Purpose
Related basic.statements
basic.array.variable
basic.ac.expression
basic.replace
basic.insert
basic.locate
basic.array.dimensioned
basic.write
basic.array.dynamic
basic.array.references
basic.read
basic.vc.expression
basic.del
basic.assignment
basic.functions
basic.sc.expression