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.

Paramete<br />

r Description<br />

N Specifies that only numbers match the pattern.<br />

text Specifies a literal string to search for.<br />

field.expr Specifies a portion of the str.expr to return. Each code segment is considered<br />

to be a field for the purposes of field.expr.<br />

Examples<br />

MATCHFIELD Parameters (continued)<br />

In the following example, the program segment returns the value 56 because the<br />

entire string matches the specified criteria, and the third field contains the number 56:<br />

SSN = "534-56-5565"<br />

MID = MATCHFIELD(SSN,"3N'-'2N'-'4N",3)<br />

In the next example, the program segment searches the string and returns the second<br />

and fourth fields and prints “99922”:<br />

STRING = "ALL999WERE22ABSENT"<br />

NUM1 = MATCHFIELD(STRING,'3A3N4A2N6A',2)<br />

NUM2 = MATCHFIELD(STRING,'3A3N4A2N6A',4)<br />

PRINT NUM1:NUM2<br />

MATCHFIELD 1-445

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

Saved successfully!

Ooh no, something went wrong!