Braincast #002 - Control Statements in AppleSoft BASIC
Bryon Lape
AppleSoft BASIC has commands to jump around the code. These are GOTO and GOSUB. Although a source of ridicule from the Computer Science purists, GOTO and GOSUB can lend power and stricture to a program. Here Brainmuffin discusses the differences between the two and when to use them.
The IF-THEN statement creates the ability to test for certain conditions and react accordingly. Though AppleSoft BASIC contains no ELSE portion, nor does it allow for a blocked IF, the command will execute all statements after the THEN when a true condition occurs. Here a program can be written to do multiple items on each line.
Writing IF/THEN with AppleSoft sometimes does need some preparation when an ELSE condition really is required. This means any NOT conditions will also have to be tested.
Combining the power of GOTO/GOSUB with the IF/THEN will create a more structured program. Branching statements need not be used in an unconditional manner, it just takes some better planning. Spaghetti code can be written in any language. Plan well and structure your code. ... https://www.youtube.com/watch?v=XCCXpDdwVaU
123715013 Bytes