Programming notes: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
[[programming features|Programming Features]] - <strong>Miscellaneous Programming Notes</strong> | [[programming features|Programming Features]] - <strong>Miscellaneous Programming Notes</strong> | ||
== Misc Programming Notes == | |||
=== Rainbow mode === | |||
If you place an F1 character inside the quotes of text to be sent, rainbow mode will be turned on, using the system colors defined in SETUP. Turn off by placing an F3 character inside the quotes. | If you place an F1 character inside the quotes of text to be sent, rainbow mode will be turned on, using the system colors defined in SETUP. Turn off by placing an F3 character inside the quotes. | ||
=== Color Sequencing === | |||
If you place an F5 character inside the quotes, the cursor will change to the next color from the sequence defined in SETUP. | If you place an F5 character inside the quotes, the cursor will change to the next color from the sequence defined in SETUP. | ||
=== Border Color === | |||
If you place an F7 character inside the quotes, the border/screen will change to black. | If you place an F7 character inside the quotes, the border/screen will change to black. | ||
| Line 19: | Line 20: | ||
=== Sequential File Display === | |||
To read a sequential file from the System Files, use the following: | To read a sequential file from the System Files, use the following: | ||
| Line 25: | Line 26: | ||
=== Data Input from File === | |||
To input data from a sequential file you may be using for data storage, you can use normal INPUT commands as always. There are ML routines to do the same thing, but it is not necessary that you use it; INPUT# should work fine in most cases. | To input data from a sequential file you may be using for data storage, you can use normal INPUT commands as always. There are ML routines to do the same thing, but it is not necessary that you use it; INPUT# should work fine in most cases. | ||
=== Capture User Input === | |||
* To input a typed line from the user, use <strong>GOSUB 310</strong>. Your caller's input will be stored in I$. | * To input a typed line from the user, use <strong>GOSUB 310</strong>. Your caller's input will be stored in I$. | ||
| Line 41: | Line 42: | ||
=== Caller Log === | |||
To store something in the caller log, do one of the following: | To store something in the caller log, do one of the following: | ||
| Line 48: | Line 49: | ||
=== Carrier Lost Check === | |||
After inputting from the user or reading a seq file, if you check the value of P, you will be able to determine if there has been a carrier lost. If P=255, then either carrier was lost or there has been a timeout. If P=1 then the caller typed CTRL/P and you should assume they want to abort the current function. Generally, after every input, it is recommended to have the following line of code: <strong>IF P THEN RETURN </strong> | After inputting from the user or reading a seq file, if you check the value of P, you will be able to determine if there has been a carrier lost. If P=255, then either carrier was lost or there has been a timeout. If P=1 then the caller typed CTRL/P and you should assume they want to abort the current function. Generally, after every input, it is recommended to have the following line of code: <strong>IF P THEN RETURN </strong> | ||
=== Disk Error Check === | |||
To check the error channel after accessing the disk drive, use <strong>GOSUB 510</strong>. If there was a disk error, it will automatically print to your screen and the caller's. The variables er, er$, et, es will contain the disk status. Some types of disk errors will not print and should be handled by your routine if necessary. They are #62, #63, #64 and #73. Also, if there is a disk full error, <strong>GOSUB 510</strong> will automatically validate the disk. | To check the error channel after accessing the disk drive, use <strong>GOSUB 510</strong>. If there was a disk error, it will automatically print to your screen and the caller's. The variables er, er$, et, es will contain the disk status. Some types of disk errors will not print and should be handled by your routine if necessary. They are #62, #63, #64 and #73. Also, if there is a disk full error, <strong>GOSUB 510</strong> will automatically validate the disk. | ||
=== Select Systems Drive === | |||
To select the system files drive: <strong>GOSUB 481</strong> | To select the system files drive: <strong>GOSUB 481</strong> | ||
=== Convert Input (I$) to Numeric Format === | |||
To convert I$ to a numeric format, use <strong>GOSUB 610</strong>. The numeric value will be held in variable I. And if I$ contains non-numeric information, the variable I will be equal to 0. | To convert I$ to a numeric format, use <strong>GOSUB 610</strong>. The numeric value will be held in variable I. And if I$ contains non-numeric information, the variable I will be equal to 0. | ||
=== Spare Commands === | |||
To use one of the "spare" commands in SETUP, refer to the table below to determine which command to use. | To use one of the "spare" commands in SETUP, refer to the table below to determine which command to use. | ||
Revision as of 19:14, 23 February 2026
Programming Features - Miscellaneous Programming Notes
Misc Programming Notes
Rainbow mode
If you place an F1 character inside the quotes of text to be sent, rainbow mode will be turned on, using the system colors defined in SETUP. Turn off by placing an F3 character inside the quotes.
Color Sequencing
If you place an F5 character inside the quotes, the cursor will change to the next color from the sequence defined in SETUP.
Border Color
If you place an F7 character inside the quotes, the border/screen will change to black.
To reset the background color or uppercase mode, do the following: GOSUB 13680
Sequential File Display
To read a sequential file from the System Files, use the following:
- f$="filename":gosub205
Data Input from File
To input data from a sequential file you may be using for data storage, you can use normal INPUT commands as always. There are ML routines to do the same thing, but it is not necessary that you use it; INPUT# should work fine in most cases.
Capture User Input
- To input a typed line from the user, use GOSUB 310. Your caller's input will be stored in I$.
- To get one character from the modem/console, use GOSUB 110. If a character had been typed, it will be stored in A$.
- To wait for a Y/N response, use GOSUB 1010. Their response will be in A$.
- To ask "Are you sure?", use GOSUB 1005
Caller Log
To store something in the caller log, do one of the following:
- a$="info to save":gosub8004 or
- i$="info to save":gosub8003
Carrier Lost Check
After inputting from the user or reading a seq file, if you check the value of P, you will be able to determine if there has been a carrier lost. If P=255, then either carrier was lost or there has been a timeout. If P=1 then the caller typed CTRL/P and you should assume they want to abort the current function. Generally, after every input, it is recommended to have the following line of code: IF P THEN RETURN
Disk Error Check
To check the error channel after accessing the disk drive, use GOSUB 510. If there was a disk error, it will automatically print to your screen and the caller's. The variables er, er$, et, es will contain the disk status. Some types of disk errors will not print and should be handled by your routine if necessary. They are #62, #63, #64 and #73. Also, if there is a disk full error, GOSUB 510 will automatically validate the disk.
Select Systems Drive
To select the system files drive: GOSUB 481
Convert Input (I$) to Numeric Format
To convert I$ to a numeric format, use GOSUB 610. The numeric value will be held in variable I. And if I$ contains non-numeric information, the variable I will be equal to 0.
Spare Commands
To use one of the "spare" commands in SETUP, refer to the table below to determine which command to use.
| Command | Loads Program | Executes Line |
|---|---|---|
| Spare 1 (in 8.10a, default for games) | √bbs.msgs | 13430 |
| Spare 2 (in 8.10a, default for User Profile) | √bbs.xfer | 13440 |
| Spare 3 | √bbs.ov1 | 13450 |
| Spare 4 | √bbs.ov2 | 13455 |
| Spare 5 | √bbs.ov3 | 13460 |
| Spare 6 | √bbs.ov1 | 13465 |
| Spare 7 | √bbs.ov1 | 13470 |
| Spare 8 | √bbs.ov1 | 13475 |
| Spare 9 | √bbs.ov1 | 13480 |
As you can see, there is one spare command pointed to each program file with spare 6 through 9 all pointing to √bbs.ovl. This allows you to put all you smaller files in √bbs.ovl and save √bbs.ov2 and √bbs.ov3 for larger files (the included Mod Menu program uses √bbs.ov2). For Color 64 v8.10a, Spare 1 and 2 commands are being utilized for Games and User Profile Editor respectively.
If you want to have lots of little programs in ov2 or ov3, I recommend you design a menu that is called spare 4 or spare 5, then have this command select the desired subroutine.
Next section: Generic Routines