The Basic was SO BAD that I had to learn Z80 assembly to make anything good. Really.
No sane Basic should leak stack memory just because you exited an "If-Then" block without reaching the corresponding "End". Yes that's a thing. If you use "If-Then" and the code never reaches the "End" because you used "Goto" to leave the block, a few bytes are leaked every time that happens, and eventually the program stops with "ERR: Memory". You needed to use "If" then "Goto" on the immediate next line, and that would avoid the leak. Exiting the program or stopping it will give you back all the leaked memory, including seeing that error.
Then you have the lack of actual subroutines or functions. All you can do is call into a separate program, and return things by putting them in specific variables. But the Basic doesn't even have "Gosub".
Also, it's very very slow.
That wasn't "leaking stack memory" except in a very literal sense: the BASIC language keeps a stack of the control structures you're inside, so that when you hit an "End" or "Else" statement it knows where to go next. This "stack" of control structures isn't lexically scoped; it's dynamic, based on what control flow commands you've hit. So yes, if you use "Goto" to set up a situation where you're hitting "Then" over and over without ever hitting a corresponding "Else" or "End", the control flow stack will just keep getting deeper and deeper. That's not a "leak" per se: all those "Then" structures are still there, waiting for their "End"s, and will do the natural thing if you give their "End"s to them — even somewhere someone used to lexically scoped languages wouldn't expect. Sometimes you can do cool things with this.
See subsection 2.1 in https://www.ticalc.org/archives/files/fileinfo/145/14542.htm...
(I should add that the first image on that page shows one neat effect of non-lexicality: you can put an "Else" statement as the body of an "If", so that it's skipped when the "If"'s condition is false.)
But isn't that just how the world works? As kid I got ERR:MEMORY allot while trying to create games. It was until I started to read a C book which said "We will not use goto in this book. It is a dangerous function that can lead to memory leaks. For example if you jump out of a function, said function will stay in memory because it never finishes." That was the light bulb moment for my TI-Basic problems.
For me the bad part is that the official TI-83 manual has a code example for the GETKEY function that is using GOTO to jump out of a loop.
No, it's not how the world works. The warning about "goto" in C is about memory leaks due to misusing malloc/free. The issue with TI-Basic is about the interpreter using a stack for if/else/end blocks.
In normal programming languages, If-Then-Else is made up of a conditional branch to get you into either the "If" part or the "else" part, and a jump to skip you past the "else" part to the "end if" part. There is no stack used for that.
hm ok. Still, my misunderstanding helped me to write TI-Basic programs that no longer crashed. :-)
Yep. It was an incredibly constrained environment, which honestly made me feel so happy when I got things to work well :)
I wonder if I still have my minesweeper program on my old calculators.
Also there are only 27 variables. Which made it hard for me to write a Snake clone until I figured out how to use Lists.