Basic variables

From Color 64 BBS Wiki

Programming Features - Basic Variables Used in Color 64

The table below defines all variables used by Color 64 BBS:

List of Color 64 Defined Variables
Var Definition and Function
A General use numeric variable. It is used to store the current number of lines in the message editor and other routines that use the array A$().
A$ This variable has several uses: It is used to return the character read in in the routine at line 110. It is used very often for when information is read in from disk also. Also, the general output commands (#, $, %, & and ') will print the contents of A$ if no string expression is specified. This is a very useful shortcut in many cases and saves programming space.
A$() This is the most heavily used string array in the Color 64 system. It is used in the message editor to hold the message lines. It is also used by many other routines which handle larger amounts of string information. It is always dimensioned to 232 when the system is first initialized.
A1$ First line of current caller's address as stored in the password file.
A2$ Second line of current caller's address as stored in the password file.
A3 Used in the main overlays to flag that an operation with AUX3 (Games) is about to be performed. Immediately clears after use at line 104. Applies to version 8.1a only.
AG Current caller's access group as stored in the password file.
AR% Used only in Network overlays, to determine which message category public messages get released into, and which UD directory that Network file transfers are released into. Defined in Net Setup.
AT Stores whether your modem supports DTR disconnect or not.
AZ$ The MODEM INIT string for Hayes type modems as defined in SETUP (Ex. ATE1X1S0=1S2=43F1Q0V1M0).
B General Use
B$ General Use
BA Used only in the Network overlays, this holds the current balance of the caller.
BD Current caller's date of birth in ADN format as stored in the password file.
BD$ Current caller's date of birth in the form "MM/DD/YYYY", calculated from the variable BD.
BM Lowest message number on the system as stored in √variables.
BN% Used only in Network overlays. If this variable is set the system is to lock out nodes when, upon attempting to call a remote node, a NO CARRIER status is returned from the modem. Defined in Net Setup.
BR Current caller’s baud rate.
BS Last used block size of the current caller. If it is a 0, the caller last used Xmodem, otherwise they last used Punter.
C General use variable which is often used to temporarily compute the current caller's absolute download credit.
C$ General use variable which is used many times to temporarily hold the contents of TX$, so that the previous value of TX$ can be preserved in cases where TX$ needs to be changed.
C1 Number of download blocks given for each block uploaded as defined in SETUP. See also C2, PD, and PU.
C2 Number of free upload blocks you give each caller as defined in SETUP. See also C1, PD, and PU.
C2$ This variable is two cr$'s added together. Again, it saves memory and time to print c2$ instead of cr$cr$ or chr$(13)chr$(13).
C3 Credit system exemption level as defined in SETUP.
C4 Maximum files you want to allow on your public messages drive as defined in SETUP.
CA Stores the current message category. It is only used in √bbs.msgs.
CA$() Category names as defined in SETUP.
CA%() The category of each message stored in public messages.
CA() The level for each category as defined in SETUP.
CC Number of message categories as defined in SETUP.
CD Your modem's carrier detect status value as defined by SETUP.
CL% The Network window closing hour as defined in Net Setup.
CM%() This integer array stores the BBS COMMANDS as defined in SETUP. This array is also used to store some miscellaneous SETUP parameters.
CR$ This variable stores the value of a carriage return. It saves memory and time to print cr$ instead of chr$(13).
CS$ Chat subject that is displayed at the ONLINE: prompt after a caller requests chat mode.
D() This variable array stores the drive assignments for your file groups as defined in SETUP. It is not wise to change these values unless you understand how the device number and drive number has been encoded in the variable; use GOSUB481-489 to select the desired drives.
D1 The current month as computed by the timer routine at 1110-1190.
D1$() The array (1 to 12) of month names, January to December.
D2 The current day of the week (0 to 6, for Sunday to Saturday) as calculated by the timer routine at 1110-1190.
D2$() The array (0 to 6) of names of the days of the week, Sunday to Saturday.
D3 The current day of the month as calculated by the timer routine at 1110-1190.
D4 The current year as calculated by the timer routine at 1110-1190.
DA Current system ADN (Absolute Day Number). See the section on Absolute Day Numbers for more information.
DA$ Current system date in the format "MM/DD/YYYY". It is calculated from the variable DA.
DC Maximum number of downloads per call as defined in SETUP.
DD Default download directory. This is always the first directory defined in SETUP with a Y to download status. See also UD.
DD$ Current caller's membership information.
DE$ This variable stores the value of a DELETE character (CBM ASCII chr$(20)).
DH$() Drive init commands for the UD directories as defined in SETUP.
DN$() Names of the UD directories as defined in SETUP.
DN%() Miscellaneous UD directory parameters as defined in SETUP.
DR$ Drive number of the currently selected drive (e.g. 0:, 1:, etc.).
DT Number of downloads made made by the caller on this call.
DV Device number of the currently selected drive.
DX Last selected device/drive. The system uses this variable to save time so that the system will not reselect a drive that was already selected. Also, setting this variable to 0 followed by a GOSUB460 will force a reselect of the current drive.
E1$ This variable stores the first 3 or 4 disk errors that are displayed on the waiting for caller screen.
ED Current caller's membership expiration date as stored in the password file as an ADN.
ED$ Current caller's membership expiration date in the format "MM/DD/YYYY". Calculated from ED.
EM$ Stores user actions/summary for email report
ER Error number read in from disk error channel by the routine at 510.
ER$ Error description read in from disk error channel.
ES Error sector read in from disk error channel.
ET Error track read in from disk error channel.
F$ This variable stores the last filename accessed. Use F$="filename":GOSUB210 to read a seq file to the screen and modem. In some cases, this variable is used to store temporary string data.
F%() This array variable, along with F(), stores the field pointers for password file records.
F() This array variable, along with F%(), stores the field pointers for the password file records. This allows easier modifications to the password file (for system upgrades) by simply changing the values in SETUP instead of through all of the other program overlays.
F(0) The BBS's RERUN ON ERRORS status as defined in SETUP.
F1$ Sometimes used for filename storage prior to calling subroutine for file open.
FI$ This variable stores the filename being edited by the online message editor. It is also used in the directory maintenance routines.
FL Set to 1 if your BBS is using 1541 Flash! from Skyles Electric Works.
FM Status of the current caller's word wrap condition (use only in the message editor). If it is a 1, word wrap is on. If it is a 0, word wrap is off.
FR Flag for the FROM information of the last read message.
FR$ FROM information of the last read message.
FU This variable, along with FU$, RX%, TE$, TX%, TY, and Z3, is used only in the √bbs.term program and is removed from memory when the term program automatically uses the variable killer.
FU$ See variable FU.
G$() Mod menu array dimensioned each time mod menu is entered and removed from memory when the mod menu is exited. Used only in √bbs.ov2.
G() Mod menu array dimensioned each time mod menu is entered and removed from memory when the mod menu is exited. Used only in √bbs.ov2.
GA% Number of game plays for use by Mod Menu. It is first defined in √bbs.init so that the variable killer routines in √bbs.ov2 do not remove it from memory.
GM Used only in √bbs.games; flag for when valid game choice is selected.
H Last selected drive number. H can be a number between 0 and 15 depending on what the last selected group of files was (e.g. Password File, System Files, Public Messages, etc).
H$ The last used drive init command.
H$() The drive commands for your drive assignments as defined in SETUP (e.g. i0, ui, hm4 20 28).
HD$() The custom message header information as read in when a user selects [R]Read Public Msgs
HM Highest message number on the system as stored in √variables.
I This is probably the most used numeric variable that doesn't have a specific function. It is used mostly as a general index variable for FOR/NEXT loops.
I$ This variable is a general use variable, although it is specifically designed as the variable in which typed information is stored when the input routines at line 300-310 are used.
I$() General use array that should never be permanently dimensioned. The multi-scratch, multi-release, and multi-view functions in √bbs.xfer dimension this variable then execute a variable kill to remove it from memory when finished using it.
I%() General use array which should never be permanently dimensioned in memory. The self-contained directory regenerate routine in √bbs.xfer dimensions this array for temporary use then discards it with the variable killer when the routine is over.
IC This variable is set to 1 when your BBS is addressing an ICT hard disk system in chain mode. It is set to 0 when addressing all other drives or the ICT drive in non-chain mode.
II Another general use numeric variable, which should never be used to store important information because the caller log routine will destroy any information stored in II.
J General use variable which is often used like the variable I.
KK If this variable is set, the caller online has created a DEFAULT MESSAGE.
L1 The access level that the BBS will automatically give a caller when their membership expires date (DD$) equals the system date (DA$) as defined in SETUP.
L2 Current caller's permanent access level. If you alter a caller's access level while they are online, LV is altered and will have an effect for the remainder of the call, but it is the value of L2 that is written back in their password file.

Nuke’s note: This is a system security risk if L2 is ever used for another purpose. DO NOT USE!

LB This variable is used to store miscellaneous information about the user online. It is stored in the password file and keeps track of: page-pauser lines, 40/80 column setting, and character speed.
LC$ Last caller's membership name. If the last caller had an access level of 1, this variable will be "NEW USER". If the last caller was a Network node, then this variable will be the name of the node.
LD Current caller's last called date as an ADN (Absolute Day Number). See the section on ADN's for more information.
LD$ Current caller's last called date in the form "MM/DD/YYYY". It is calculated from the variable LD.
LG This is a temporary variable used by the caller log routines. You can also use this variable to store temporary information, but the data in LG will be destroyed if the caller log routines are used.
LG$ This variable is a temporary holding place for the information to be later stored in the caller log. When this variable is longer than about 200 characters, it will automatically be stored into an area of RAM that contains the caller log and the variable will be reset to "".
LK%() This array stores the message links in the subject chains.
LM The highest message number that a caller has read on this and previous calls. When a caller logs off, this variable will be assigned at least equal to the lowest message on the system. This allows the BBS to know if this is a caller’s first call or a second (or more) call but they had not read any messages. On a caller’s first call, we don't want to scan for mail, etc.
LM%() This variable array stores the status indicating if a level message exists for each level. These variables are assigned when the BBS in initially loaded or when the current time and date are adjusted.
LV The current caller's (or the user's being edited in password maintenance) access level. Altering this variable will only have an effect on the current call.
M Used in √bbs.msgs to keep track of last message read.
M1 The system BPS rate as defined in SETUP.
M2 Used in √bbs.msgs to keep track of next message to be read.
M3 Indicates if are using Network, as defined in SETUP.
M4 Indicates if system shall adjust BPS rate to connect rate, as defined in SETUP.
M6 The default column (word wrap) setting defined in SETUP
M7 The default Fast-Garbage-Collect mode as defined in line 10241 of √bbs.init. See the description of the !48 variable for more information.
MB Minimum number of blocks allowed on the system before messages automatically start to cycle, as defined in SETUP.
MC Maximum number of columns (word wrap setting) for the current user. Because it is used for the word wrap routines, it is set to the screen width minus 2. Thus, it is set to 38 for 40-column users and 78 for 80-column users.
MD Maximum number of days that a caller's mail will be held before it is automatically purged, as defined in SETUP.
MF%() This array stores the ID number of the user who posted each message.
MH Keeps track of the number of pieces of mail held when a caller is reading their mailbox.
ML Maximum number of lines per message as defined in SETUP.
MM Maximum number of messages on the BBS as defined in SETUP.
MN() This array stores the message number of each of the public messages.
MP Maximum password number on the BBS as defined in SETUP.
MR Number of message read so far when reading E-mail.
MR%() This variable array keeps track of which messages have already been read or not.
MS Number of messages to skip to read next piece of E-mail.
MT Used in the multidownload routines to keep track of how many files have been sent so far.
MT% Current speaker on/off setting in Network.
MU Minimum number of blocks needed to allow uploads as defined in SETUP. The BLOCKS FREE message after the directory display or before an upload will automatically be adjusted by this value.
MX Used in √bbs.msgs to keep track of next message to be read.
N General Use.
N%() Array holding status of each outgoing node.
NA$ Current caller's membership name.
NC%() This array is used to calculate the number of new messages in each category when reading public msgs.
ND Set when the date changes and is reset after the end of day routines are run.
NF$ Used to hold name and ID# of remote node.
NI% Used only in Network overlays, it’s the next open space in incoming node accounts file.
NN$ Your BBS system's name, defined in Net Setup.
NN% Number of nodes, defined in Net Setup.
NN() Prices for outgoing nodes: (x,0) = first 1000 bytes, (x,1) = each additional 100 bytes.
NU Total number of callers who have called the BBS, as stored in √variables. NU is incremented each time a different caller calls the BBS (it is not incremented if the same caller calls twice in a row).
NU$ This variable stores a chr$(0). It saves memory to use NU$ instead of chr$(0).
OP% Opening hour for the window of outgoing Network messages.
OV This variable stores a pointer number that will be used after loading another overlay to determine what line number to execute. Line 5 of every program contains an 'onovgotoXX,XX,XX' command to make sure the proper routines are run based on the value of OV.
P General status variable. If carrier is lost, p=255. If the caller types ↑p, p=1. Use "IF P THEN RETURN" after all your inputs to make sure the BBS will abort if carrier is lost or the caller types ↑p.
P$ General use.
PD Caller's current number of blocks downloaded. See also C1, C2, and PU.
PH$ Current caller's phone number as stored in the password file.
PM If this variable is a 0, the clock is in the AM range. If this variable is 1, the clock is in the PM range.
PN Used only in Network overlays, holds number of public messages received when distributing incoming messages.
PR This variable is set if you answer P to the "(S)creen or (P)rinter" question.
PS Current caller's number of posts as stored in the password file.
PU Current caller's current number of blocks uploaded. The variables C1, C2, PD, and PU are used to determine a callers download credit status with the following formula:
c2+pu*c1-pd
PW$ Current caller's password. It is saved in each caller's membership record in the password file.
QZ% Used as a flag when editing a message for when MCIs are turned off, and as a temporary holding variable.
R1 This variable is a temporary holding area for the sysops record number when using the Validate or Password Maintenance.
RA Set when the user is reading ALL message categories.
RN Current caller's record number (membership number). Also, during password maintenance this variable will be saved and will be reassigned to the value of the caller number being edited.
RN$ Current caller's real name as stored in the password file.
RU The system's auto-release level as defined in SETUP.
RX% See variable FU.
S Used only in Network overlays, holds duration of Network call.
S1 Number of new callers for current day as stored in √variables.
S2 Number of calls today as stored in √variables.
S3 Number of uploads today as stored in √variables.
S4 Number of downloads today as stored in √variables.
S5 Number of messages posted today as stored in √variables.
S6 Number of public net messages holding as stored in √variables.
S7 Number of outgoing messages to send as stored in √variables.
SB Set if you answered Y to screen blanking in SETUP.
SC Set if you answered Y to daily caller log backup in SETUP.
SD$ Current download directory prefix. If you are not using multiple directories per drive, this variable will always equal "". Otherwise, it will equal "A" for directory A, "B" for directory B, etc.
SM Highest message number read on this call. When a caller logs on, this variable is assigned the same value as LM, then as public messages are read, this variable is assigned the highest message number read. When a caller logs off, LM will be set equal to this variable, then stored in the password file.
SR This variable is used to represent the status byte of the current I/O function. ST is automatically updated by the C64 after every I/O and SR is used to save the value of ST when needed.
SU$ This variable stores the subject of the last read message.
T General use.
T$ Current time. You must GOSUB1110 to update this variable.
T() This variable array stores the daily time limits for each access level and the per call limits for AM and PM hours, as defined in SETUP.
T1 Number of invalid sign-ons since midnight last night as stored in √variables.
TA This variable, along with TB, is used by the multi-download routines to keep track of where the BBS is in the list of files to send.
TB See TA
TE$ See variable FU.
TI The total time (in jiffies) that this caller has been online.
TI$ This variable is set to "000000" when a caller logs on and is automatically incremented every second. It is used to keep track of how long a caller has been online. It is also used to keep track of how long the BBS has been waiting between calls.
TM Total minutes that this caller has for this call. TM-INT(TI/3600) represents the number of minutes that this caller has left for this call.
TS Number of times the current caller has called. It is saved in the password file.
TT This variable represents the time remaining for today less the value in TM. The total of TM and TT represent the total time the caller has for the rest of the day.
TX$ This is a special variable that Color 64 reserves for disk reads and typed input. The length of TX$ determines the maximum number of characters that can be read in from keyboard or disk. It should not be changed, except by the special system routines that need to lengthen TX$ to copy larger amounts of disk data.
TX% See variable FU.
TY See variable FU.
UD Default upload directory number. This is always the first upload directory in SETUP with a Y in the upload status.
UX This variable stores the UPLOAD DESCRIPTION status of your BBS as defined in SETUP. If it has a value of 1, your system is defined to be using upload descriptions. If it has a value of 0, your system is not using upload descriptions.
UX$ This variable is used to store the first few lines of the upload description when in the message editor in √bbs.xfer.
VE This is used by Network to store the Network version number of the remote BBS node during a Network call.
VS This variable is set if the variables have been saved and is cleared when another caller calls.
VX There are several routines all using the same message editor and this variable tells the BBS where to go after it finishes editing the message (e.g. back to Read Feedback, Read Mail, Read Messages, or Posting a Message).
WD%() This variable array stores the different caller access level's purge parameters as defined in SETUP.
X General use.
X$ Only used in Network overlays, general use.
X% Used only in Network overlays, holds current node ID#.
Z Used only in Network overlays, general use.
Z$ General use.
Z3 See variable FU.

General variables used without specific definition: A, A$, B, B$, C, C$, I, I$, II, J, N, P$, T, X, Z$

Next section: Generic Overlay Files

Programming Features