The following is a collection of programming notes and tips for Color 64 BBS v7.00. It is not intended to teach programming, but only to help the experienced programmer make modifications to the BBS.
To output text to the screen/modem, use the following format:
a$=”text to be sent”:sysc(0) – sends text followed by carriage return
a$=”text to be sent”:sysc(1) – sends without a carriage return
If you place an f1 character inside the quotes of text to be sent, rainbow mode will be turned on. Turn off by placing an f3 character inside the quotes. 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 f7 character inside the quotes, the border/screen will change to black.
To read a sequential file from the system files disk, use the following:
f$=”filename”:gosub205
To input data from a sequential file you may be using for data storage, you can use normal input commands as always. I have some ml routines to do the same thing, but it is not necessary that you use it. Input# works very well.
To input a line from the modem/console, use the following:
gosub310
Your callers input will be stored in i$.
To get one character from the modem/console, use the following format:
gosub110
If a character had been typed, it will be stored in a$.
To wait for a Y/N response, use the following:
gosub1010
Their respose will be in a$.
To ask “Are you sure?”:
gosub1005
To store something in the caller log, do one of the following:
a$=”info to save”:gosub8004
or
i$=”info to save”:gosub8003
After inputting from the modem/console or reading a seq file, if you check the value of p, you will be able to determine if their has been a carrier lost. If p=255, then either carrier was lost or their has been a timeout. If p=1 then the caller typed ^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:
ifpthenreturn
To reset the background color or uppercase mode, do the following:
gosub13680
To check the error channel after accessing the disk drive:
gosub510
If there was a disk error, it will automatically print to your screen and the callers. And the variables er,er$,et,es will contain the disk status. Several 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, the gosub510 will automatically validate the disk.
To select the system files drive:
gosub481
To convert i$ to a numberic format:
gosub610
The numeric value will be in the variable i. And if i$ contains non-numeric information, i will always be equal to 0.
To use one of the “spare” commands in SETUP, use the following chart to determine which command to use:
COMMAND LOADS PRG EXECUTES LINE
spare1 msgs 13430
spare2 xfer 13440
spare3 ovl 13450
spare4 ov2 13455
spare5 ov3 13460
spare6 ovl 13465
spare7 ovl 13470
spare8 ovl 13475
spare9 ovl 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. If you want to have lots of little programs in ov2 or ov3, I recommend you design a menu that is called by spare 4 or spare 5, then have this command select the desired subroutine.
I hope this file helps you in designing your own online modules. As more questions are asked, I will add the answers to this file. So in time, I hope to make this a complete programming guide. If you have any questions not covered here, or think I need to add something else, just let me know.
Greg Pfountz
Daily Exchange
703 466 2120