[Coco] Problems with ON var GOSUB

Wayne Campbell asa.rand at gmail.com
Thu Aug 13 15:37:00 EDT 2020


First, make sure you set the base 0. Second, make sure that you value being
input is an integer and not a real.

On Thu, Aug 13, 2020, 12:09 PM <coco at jechar.ca> wrote:

>
> The first SHELL "list /dd/SH/osd" displays the contents
> of the file  /dd/SH/osd as expected but the ON var GOSUB
> does not work. Am I missing something or do I need to rewrite
> the code using ON var GOTO and replace the returns with
> GOTO 3000s
>
> PROCEDURE testit
>
> DIM line$,c$,go$,doit$:STRING
> DIM tc,cv,custom,todo:INTEGER
> DIM fp:BYTE
>
> SHELL "list /dd/SH/osd"
>
>     LOOP
>        PRINT "+---------------------------+"
>        PRINT "| 0. Exit                   |"
>        PRINT "| 1. List File              |"
>        PRINT "| 2. Edit File              |"
>        PRINT "| 3. Run  File and Exit     |"
>        PRINT "| 4. Delete File and Exit.  |"
>        PRINT "+---------------------------+"
>        INPUT doit$
>        todo=VAL(doit$)
>        ON todo GOSUB 3100,3101,3102,3103,3104
> 3000 (* Do not actually have this line. *)
>     ENDLOOP
> END
> 3100 (* Exit *)
> END
> RETURN
> 3101
> PRINT "listing of /dd/SH/osd"
> SHELL "list /dd/SH/osd"
> RETURN
> 3102
> PRINT "Entering Editor"
> PRINT "Use ^K to delete any lines"
> PRINT "    ^S to save your changes"
> PRINT "[BREAK]to exit"
> PRINT
> INPUT "PRESS [ENTER] to Start ";go$
> SHELL "minted /dd/SH/osd"
> RETURN
> 3103
> SHELL "/dd/SH/osd"
> END
> RETURN
> 3104
> SHELL "del /dd/SH/osd"
> END
> RETURN
> END
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>


More information about the Coco mailing list