| MATCHES | Index Level | MATREAD |
| Syntax |
MATPARSE array.variable {,start {,end}} FROM dynamic.array.expression {USING delimiter} {SETTING} variable
array.variable = dynamic.array.expression |
| Category | BASIC |
| Type | Statement |
| 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". |
| Options | |
| See Also | MATBUILD MATREAD MATWRITE DIM dimensioned array dynamic array = |
| 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. |
| Warnings | If the dynamic array contains more elements than the dimensioned array, the remaining elements are put into the last location of the dimensioned array, delimited by attribute marks. |
| Compatibility | D3 7.0 AP |
| MATCHES | Index Level | MATREAD |