College LAN Only - If you are using the college LAN (local area network), you can run QBasic.
Lots of examples
Programming Assignment (LAN Only)
The list below is based on the AQA Specification. It requires the following ...
Statement |
Examples |
Explanation |
PRINT [expression list] [ { ; | , } ] |
Used to print text or numbers to the screen. Expressions are separated by commas or semicolons. |
|
FOR counter = start TO end [STEP increment] |
Used to repeat a preset / known number of times. |
|
DIM variable [(subscripts)] |
Used to declare variables. This reserves and names a location in RAM. |
|
INKEY$ |
This returns a key from the keyboard buffer. If no key has been pressed, it returns an empty string. That is an opening quote followed by a closing quote with no text in between like this "". |
|
DO [{WHILE | UNTIL} condition] |
Used to repeat code ZERO OR MORE times. |
|
DO |
Used to repeat code ONE OR MORE times. |
|
IF condition THEN |
Used for true / false decisions. If the condition is true, statement bolck 1 runs. If the condition is false, statement block 2 runs. |
|
GOSUB [label | line number] This syntax appears to be invalid with Win95 QBasic |
GOSUB is used to jump to a subroutine. SUB begins a subroutine. RETURN ends a subroutine (also END SUB) |
|
| INP (port %) |
Input data from the numbered port. |
|
INPUT [ ; ] ["prompt" {; | , }] variable list |
Input data from the keyboard. (comma or semicolon separated) |
|
LPRINT [expression list] [ { ; | , }] |
Send a line of printing to LPT1 (the printer port). There will be a device error is no printer is connected. |
|
OUT port, data |
Output data too a port. The Parallel Port on addresses &H378, &H379 and &H37A is commonly accessed in this way. |
|
REM remark (the single quote ' sign can be used instead) |
Used for human readable comments that are not part of the program. These comments should explain what is going on and why. They should not just repeat the code and state the obvious. N% = N% + 1 ' Add one to N% (stupid brain dead comment) N% = N% + 1 ' Make N% point to the next data item (OK) |