[Coco] INSTR command.

Allen Huffman alsplace at pobox.com
Wed Aug 15 16:41:36 EDT 2018


Character position starts with 1, not 0, I believe.

Sent from my iPhone

> On Aug 15, 2018, at 3:26 PM, coco at jechar.ca wrote:
> 
> 
> From what I understand the command
> 
> C=INSTR(S,SR$,"X")
> 
> Should work and give me a 0
> if X is not found in the string SR$
> or a number corresponding  to the position
> of X in the screen.
> 
> ie.
> 
> 10 S=0:SR$="SEX";C=0
> 20 C=INSTR(S,SR$,"X")
> 30 PRINT C
> 
> Should come back with 3
> 
> Instead I get a  ?FC ERROR IN 20
> 
> This is the standard Coco3 basic I am running.
> 
> Anyone got any Idea what I did wrong.
> 
> 
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco


More information about the Coco mailing list