11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Parameter Description<br />

SETTING location Returns the location of the string. If the search is not successful,<br />

execution depends on the presence of the BY clause:<br />

If the BY clause is included, the array is assumed to be sorted,<br />

and a location is returned indicating where the element should be<br />

inserted to maintain the array in sorted order.<br />

If the BY clause is not included, the array is assumed to be<br />

unsorted, and the location returned is of the last element plus<br />

one.<br />

THEN statements END THEN (optional) is executed when the search is successful.<br />

Multiple line THEN or ELSE statements require an END<br />

keyword.<br />

ELSE statements END ELSE (required) is executed if the search is unsuccessful.<br />

Multiple line THEN or ELSE statements require an END<br />

keyword.<br />

Note: The syntax for BASICTYPEs P and M differs in the number of array elements<br />

you can include and the search driven by those elements. Syntax variants for P and<br />

M are as follows:<br />

LOCATE element IN dyn.array [BY search.type]<br />

SETTING location [THEN statements END] ELSE statements END<br />

and<br />

LOCATE Parameters (continued)<br />

LOCATE(element,dyn.array [,attrib.expr[,val.expr]];location [;search.type])<br />

[THEN statements] [END] ELSE statements<br />

LOCATE 1-421

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

Saved successfully!

Ooh no, something went wrong!