basic.matparse Statement/BASIC Program

basic.matparse

Command basic.matparse Statement/BASIC Program
Applicable release versions: AP
Category BASIC Program (486)
Description converts a dynamic array into a dimensioned array.

"array.variable" references the dimensioned array.

"start" is an integer expression which indicates the optional starting position within the "array.variable" to begin updating. If omitted, it defaults to 1 (one).

"end" is an integer expression which indicates the optional ending position within the "array.variable" to stop updating. If omitted, it defaults to the array size previously declared with a "dim" statement for the given array. In all cases, the last array element will be assigned all the remaining elements in the dynamic array.

"dynamic.array.expression" is the data to be used to update the array.

"delimiter" is the optional delimiting character within the string to be used to separate data parsed into the array. If omitted, the default delimiter is an attribute mark (char(254)). The "delimiter" may be any character between x'00' and x'fe', but must be a string.

"variable" indicates the number of elements of "array" that were assigned a value.

In the form:

array.variable = dynamic.array.expression

Each attribute in "dynamic.array.expression" is assigned to an element in "array.variable".
Syntax matparse array.variable {,start {,end}} from dynamic.array.expression {using delimiter} {setting} variable

array.variable = dynamic.array.expression
Options
Example
dim a(10)
rec<1> = "test1"
rec<2> = "test2"
matparse a from rec setting attr.count
print a(1)

test1

a = ""
a<1> = "larry"
a<2> = "moe"
a<3> = "curly"
dim stooges(4) 
mat stooges = "unknown"; * initialize
stooges = a;* matparse equivalent
print stooges(3) : " " : stooges(4)

curly

 Notice that stooges(4) was null.
Purpose
Related basic.matbuild
basic.matread
basic.matwrite
basic.dim
basic.array.dimensioned
basic.array.dynamic
basic.=