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 />

Examples<br />

In the following example, the program segment searches for 3 in the string DA. This<br />

results in F=3, V=1, and S=0 because 3 is found in the third attribute as the first multivalue,<br />

and this attribute has no subvalues.<br />

1-264 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

f,v,s Specifies variables in which to place the position of substr:<br />

f – Attribute<br />

v – Value<br />

s – Subvalue<br />

If the attribute found has neither multivalues nor subvalues, then v and s,<br />

if specified, are set to 0. If only multivalues are present, s is set to 0. If only<br />

subvalues exist, v is also set to 0.<br />

THEN<br />

statements<br />

ELSE<br />

statements<br />

DA = 1:@AM:2:@AM:31:@VM:32:@VM:41:@VM:41:@VM:42:@VM:43<br />

FINDSTR 3 IN DA SETTING F,V,S ELSE PRINT "NOT FOUND"<br />

In the next example, the program segment searches for the second occurrence of 4 in<br />

the string DA. This results in F=3, V=4, and S=0 because the second occurrence of 4<br />

is found in the third attribute as the 4 multivalue, and this attribute has no subvalues.<br />

DA = 1:@AM:2:@AM:31:@VM:32:@VM:41:@VM:41:@VM:42:@VM:43<br />

FINDSTR 4 IN DA,2 SETTING F,V,S ELSE PRINT "NOT FOUND"<br />

Related <strong>Commands</strong><br />

<strong>UniBasic</strong><br />

FIND, LOCATE<br />

Specifies statements to execute if the substr is found in the array. Either a<br />

THEN statement or an ELSE statement is required.<br />

Specifies statements to execute if the substr is not found in the array. Either<br />

a THEN statement or an ELSE statement is required.<br />

FINDSTR Parameters (continued)

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

Saved successfully!

Ooh no, something went wrong!