basic.extract

Function/BASIC Program, Releases: AP and R83

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

Command Name Type Description
basic.statements Definition Definition of statements and functions.
basic.array.variable Definition References a dimensioned array.
basic.ac.expression Definition Derives an attribute count.
basic.replace Function Replaces element in string expression.
basic.insert Function Inserts element into array.
basic.locate Statement Locates element in string expression.
basic.array.dimensioned Definition a table where the contents of the elements can be altered (replaced) but the position of each element is fixed.
basic.write Statement Writes dynamic array to file.
basic.array.dynamic Definition A string variable delimited by reserved metacharacters.
basic.array.references Definition Referencing arrays.
basic.read Statement Reads item into dimensioned or dynamic array.
basic.vc.expression Definition Derives a value count.
basic.del Statement Alternate method of 'delete'.
basic.assignment Definition Assigns value to variable.
basic.functions Definition elements in FlashBASIC or Pick/BASIC language expressions, returning a single value in place, as a function of the arguments. A function can be used anywhere a variable or expression is used.
basic.sc.expression Definition Derives a subvalue count.

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.