[Coco] Let's say you wrote a BASIC program the user is invited to change

Juan Castro jccyc1965 at gmail.com
Thu Jul 10 12:08:46 EDT 2025


For example, it solves an equation, or plots a graph, and the user is
supposed to edit the line where the function is defined. So you print
a message telling them they can edit line XXX for that purpose.

Or you want to say the user can change something's color by changing
the value of variable C in line YYY.

If you renumber the program, you'll have to go back and re-edit any
message like that, right? Well, no longer. Now you can use "GOTO nnnn"
as an expression and print it! Like this:

https://www.dropbox.com/scl/fi/gy5svbpsycvmr1uc8c70c/GOTOasExpression.mp4?rlkey=fit9ljec12on0ri4oxq0yp0wo&st=71tbzuls&dl=0

The only change was in the expression evaluation routine. If I find
the tokens for GOTO, I skip them and otherwise act normally. RENUM
didn't need any changes -- whenever it finds a GOTO followed by a
number, it changes it.

As usual, you can find the stuff here:
https://www.dropbox.com/scl/fo/9p5ydq5hqgp4b1fbqyyif/AKnngotPgk1PLUm6kw0nn5U?rlkey=pxtfum7dzwno0ej42bfb8ucrb&st=duyykgkj&dl=0

Juan Castro
Enviado do meu Olivetti Programma 101
http://retropolis.com.br


More information about the Coco mailing list