Closed szczys closed 6 years ago
This is not that trivial as I anticipated - the list function would have to make the same syntax check as the interpreter itself in order not to get lost in the program. As a workaround, I implemented MORE function since v 0,40. After invoking, it outputs first 19 lines of code - the same as list function - but then it emits "---hit any key for more, q to quit---" line. Printing of program is suspended until user hits a key; if it's q, everything returns back to CLI, or prints another 19 lines for any other key.
The proposed behavior is good, but 'q' is not working for me. It causes 19 more lines to be listed.
Also, your sample program has invalid command at line 1. If I try to type in a new line 1 the badge resets: 1 goto 3
Do you see this behavior as well.
Yes, the basic program was broken, with few non-functional parts, especially the part "1 poinless long program\n\2 to sport MORE function\n\" in first two lines, it was intended just as model to show MORE functionality.
I fixed the 'q' bug, it should work OK in 0.41
V 0.42 is out, should fix both the reset after adding the "1 goto 3" line, as well as subsequent incorrect insertion.
More function works great! 'q' is now working. Nice.
There's still something funky with getting rid of a line. If you just type the number with nothing after it you sometimes get junk. If you type number with nothing after it twice in a row it gets removed.
If user wants to examine a specific line of code, it would be helpful to do so directly with the
list
command. Basic functionality might work like this:list
, entire program is listed and can be scrolled with up and down (already implemented but currently broken #14 )list 140
, line 140 is shown at the top of the screen with following lines listed to fill the screen