Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?



The MATPARSE statement is used to assign the elements of a matrix from the elements of a dynamic array. It takes the general form:

MATPARSE array{, expression1{, expression2}} FROM variable1 {USING expression3} SETTING variable2


  • array is a previously dimensioned matrix, which will be assigned to from each element of the dynamic array. variable1 is the jBASE BASIC variable from which the matrix array will be stored.
  • expression1 and expression2 should evaluate to numeric integers. expression1 specifies which element of the array the assignment will start with; expression2 specifies which element of the array the assignment will end with (inclusive).
  • By default, the dynamic array assumes the use of a field mark to separate each array element. 
  • By specifying expression3, the separator character can be changed. If expression3 evaluates to more than a single character, only the first character of the string is used.
  • As assignment will stop when the contents of the dynamic array have been exhausted, it can be useful to determine the number of matrix elements that were actually assigned to. 
  • If the SETTING clause is specified then variable2 will be set to the number of elements of the array that were assigned to.

When specifying starts and end positions with multi-dimensional arrays, it is necessary to expand the matrix into its total number of variables to calculate the correct element number. See the information about dimensioned arrays earlier in this section for detailed instructions on calculating element numbers.

An example of use is as:

DIM A(40)

Assign 5 elements of the array starting at element 3. 

Back to jBASE BASIC.

Was this article helpful?