[Coco] INSTR question
Robert Hermanek
rhermanek at centurytel.net
Thu Feb 9 17:03:41 EST 2017
Issue is just getting a return of 1 when searching for empty string?
Then why not:
10 ON INSTR(" ABC",INKEY$) GOTO 10,100,200,300
...notice the space before A.
-RobertH
On 2/9/2017 3:48 PM, Allen Huffman wrote:
>
> 10 IF A$<>"" THEN LN=INSTR("ABCD",A$):ON LN
>
> It's a pity, because ON x GOTO/GOSUB ignore the 0 value, so it it worked the same way, this could be done:
>
> ON INSTR("ABC",INKEY$) GOTO 100,200,300
>
> That's quite a bit faster than using a variable.
>
> -- A
>
More information about the Coco
mailing list