A computer program is a series of instructions that run sequentially.
There are three broad categories of instructions:
- Data Manipulation
- I/O (Input/Output)
Data manipulation includes the assignment of data to a variable (X=10), the copying of data between variables (Y=X), as well as mathematical operations on the data.
Logic would include any instruction that makes a decision based on data provided.
Input would include instructions that collect data from various sources such as a key press from the keyboard (INPUT) or a text file from a hard drive.
Output would include instructions that display text (PRINT) or graphics on the screen or write a text file to a hard drive.
In this example program, the REPEAT and UNTIL will loop while waiting for a key press. While no key is pressed, the variable RESULT will be an empty string. An empty string in Ozapell Basic equates as FALSE. Any key press will equate as TRUE. UNTIL will jump back to its REPEAT until RESULT equals TRUE. After a key is pressed, the variable RESULT is copied to the variable TEXT. PRINTLINE uses TEXT to display the key pressed.