basic.extract
Extracts element from array.
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>
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.
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'.
See Also
User Comments
What do you think?
Share your experience or ask a question by using the form below.
Login to leave your comments.
