matbuild Statement

The matbuild statement converts a dimensioned array into a dynamic array.

Syntax

matbuild dyn.array.var from array.var{,start {,end}} using delimiter 

dyn.array.var = array.var

Parameter(s)

dyn.array.var

Variable constructed from all or part of a dimensioned array.

NOTE—If the dimensioned array contains any unassigned elements, a message indicating this displays and a null dynamic array variable is returned.

array.var

References the dimensioned array. If any elements in the dimensioned array are unassigned, a message indicating this displays and a null dynamic array variable is returned.

start

Integer expression that indicates the optional starting position within the array to begin parsing. If omitted, it defaults to 1. The value of start must be numeric.

end

Integer expression run time indicates the optional ending position within the array to stop parsing. If omitted, it defaults to the array size previously declared with a dim statement for the given array. The value of end must also be numeric.

delimiter

Optional delimiting character within the string to be used to separate data parsed from the array. If omitted, the default delimiter is an attribute mark (char(254)). The delimiter can be any character between x’00’ and x’fe’.

Example(s)

dim a(10)

for x = 1 to 10

a(x) = x

next x

matbuild xyz from a,4,9 using char(253)

print xyz

Output result would be the following:

4]5]6]7]8]9

 

dim a(4)

a(1) = "larry"

a(2) = "moe"

a(3) = "curly"

a(4) = ""

stooges = a

print stooges

Output result would be the following:

larry^moe^curly

Note that because the final element of the dimensioned array is null, it is not appended to the dynamic array.

See Also

= Assignment Operator, matparse Statement, matread Statement, matwrite Statement