17.08.2013 Views

Contents, cont'd. - Intermec

Contents, cont'd. - Intermec

Contents, cont'd. - Intermec

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

INSTR<br />

Chapter 2 Program Instructions<br />

Field of Application Function searching a specified string for a certain character, or sequence<br />

of characters, and returning its position in relation to the start of the<br />

string.<br />

Syntax INSTR([,],)<br />

1 2<br />

is , optionally, the position where the search will start.<br />

1<br />

2<br />

is the string to be searched.<br />

is the character(s) for which the string will be searched.<br />

Remarks INSTR allows you to search a string for some particular character(s) and<br />

return the position of the character, or the first character in the sequence, as<br />

a number of characters positions measured from the start of the string.<br />

As an option, it is possible to specify a certain position in the string from which<br />

the search will start. If no start position is specified, the search will start at the<br />

beginning of the string.<br />

The result will be zero if<br />

- the start position value exceeds the length of the string.<br />

- the string is empty.<br />

- the searched combination of characters cannot be found.<br />

Examples In this example, the string "INTERMEC_PRINTER_AB" is searched for the<br />

character combination "AB". No start position is specified.<br />

10 A$="INTERMEC PRINTER AB"<br />

20 B$="AB"<br />

30 PRINT INSTR(A$,B$)<br />

RUN<br />

yields:<br />

18<br />

In next example, the string "INTERMEC_PRINTER_AB" is searched for the<br />

character "I" and the start position is specified as 4.<br />

10 A$="INTERMEC PRINTER AB"<br />

20 B$="I"<br />

30 PRINT INSTR(4,A$,B$)<br />

RUN<br />

yields:<br />

12<br />

<strong>Intermec</strong> Fingerprint 7.2 – Reference Manual Ed. 3 113

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

Saved successfully!

Ooh no, something went wrong!