Quantcast
Viewing all articles
Browse latest Browse all 2543

programming • whats wrong with this simple code?

Hi , I am tentatively getting into programming via my Dad's old Beeb.
I did other stuff at school like Visual Basic, some Python

Was playing with a bit of simple code that has a stored file of
lines of text. The code displays it , then prompts for a new line to be stored and added
to the file. Then it will display the new list and return to the start.
I keep getting various errors. I originally had an X=OPENOUT "LIST" in the
PROCSAVE procedure but I realised it was always wiping the entire list.
I have messed about with this for a couple days but not seeing where I am going wrong.

thanks

Code:

 5 REM program to print a list of text entries,  prompts for further input to the file, then displays updated list. 7 CLS10 PROCLOAD20 PROCSAVE30 GOTO 740 DEF PROCLOAD: Y=OPENIN “LIST”50 REPEAT: INPUT#Y, R$; PRINT R$: UNTIL EOF#(Y)60 ENDPROC70 DEF PROCSAVE80 INPUT “ What is your entry ? “, L$: PRINT#Y, L$ : CLOSE#Y90 ENDPROC

Statistics: Posted by theNoob — Wed Nov 13, 2024 11:02 am



Viewing all articles
Browse latest Browse all 2543

Trending Articles