11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Command Meaning<br />

MATREAD<br />

MATREADL<br />

MATREADU<br />

MATPARSE<br />

Examples<br />

In the following example, the program segment fills the array MAIN.MAT with<br />

values from REC. If a sufficient number of elements are available in the target array,<br />

the value of INMAT is set to the number of elements filled. If the number of values<br />

exceeds the number of elements in the target array, excess data is lumped in the 0<br />

position, and the value of INMAT is set to 0.<br />

MATPARSE MAIN.MAT FROM REC, @VM<br />

PRINT INMAT()<br />

In the next example, the program segment dimensions two arrays and then prints the<br />

dimensions using the PRINT statement and INMAT function:<br />

DIM LARGE.ARRAY(23,14)<br />

DIM SMALL.ARRAY(9)<br />

PRINT INMAT(LARGE.ARRAY)<br />

PRINT INMAT(SMALL.ARRAY)<br />

This results in the following:<br />

23}14<br />

9<br />

n – The number of attributes loaded into the array.<br />

0 – More attributes existed in the record than elements existed in the array.<br />

Excess data is stored in the 0,0 element.<br />

OPEN n – The number of modulos in the file.<br />

0 – The file opened is a directory (DIR type).<br />

OSBWRITE n – The number of bytes written to a file or named pipe.<br />

INMAT Function Return Values (continued)<br />

INMAT 1-380

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!