[Coco] Basic09 question

George Ramsower georgeramsower at gmail.com
Thu Mar 27 23:19:28 EDT 2008


DING! Goes the bell! Yeah! That's it! I just couldn't remember.
Thanks.
George

From: "Bob Devries"
> George,
> were you thinking of the ON GOSUB command?
> You can use that provided your choices are (a) numeric, and (b) sequential 
> numbers.
>
> INPUT "Choice:", answer
> ON answer GOSUB 10, 20, 30
>
> You can use ON GOTO also.
>
> If your variable is not numeric, you can convert it using the SUBSTR 
> command.
>
> Page 11-100 of the BASIC09 manual for ON/GOSUB, and 11-164 for SUBSTR
>
>
> --
> Regards, Bob Devries, Dalby, Queensland, Australia
>
> ----- Original Message ----- 
> From: "George Ramsower" >
>>I seem to remember(in my old memories) there was a way to use IF/THEN in a 
>>way that would:
>>
>> use GOSUB, line1,line2,line3.. etc. when comparing an input from the 
>> user.
>> For example:
>>
>> input"Choices", answer
>> if answer = "whatever1" then gosub 1 \endif
>> if answer = "whatever2" then gosub 2 \endif
>>
>> This is clunky.
>>
>> The thing that is in my head is that there was a way to make it do it all 
>> in one small segment instead of a whole buch of IF/THEN tests.
>>
>>
>> Does this make sense?
>>
>>
>> Thanks,
>>
>> George
>>




More information about the Coco mailing list