Toshiba KB-80 Computer Keyboard User Manual


 
- 39 -
INSTR
Function Searches for the specified characters from the character string, and provides the first
character position of the characters.
Format INSTR ( [ <numeric expression> , ] <character string 1>, <character string 2> )
Term <numeric expression>: Indicates the position in <character string 1> where the
searching of <character string 2> is started.
(Unit: bytes, Range: 1 to 255)
<character string 1>, <character string 2>: A character variable, character
expression, or character constant
Explanation The INSTR statement searches for <character string 2> from the specified position
(the <numeric expression>th bytes from the left) in <character string 1>, and then
provides the first position (byte) of <character string 2>. If <numeric expression> is
omitted, the searching starts from the first byte in <character string 1>.
In the following cases, “0” is provided.
<character string 2> is not found.
The value for <numeric expression> is larger than the value for <character
string 1>.
<character string 1> is a null string.
When a null string is specified in <character string 2>, “1” is provided.
When <numeric expression> is specified in <character string 2>, the value is
provided.
If <numeric expression> exceeds the range of 1 to 255, an “Illegal function call” error
occurs.