THE NITE LITE BBS PROGRAM

This  documentation  and  the  software it describes are copyright
1989,  Paul Swanson.   All Rights Reserved.   They are distributed
as shareware.   If  you  use this BBS program, support it by mail-
ing a registration fee of $35 to  Nite Lite Systems,  P.O.  Box R,
Billerica, MA 01821.   In  turn  you  will receive,  on disk,  the
latest update of this software.  Include the  name  and  telephone
number of your BBS so that it can be added to  the  list  of  Nite
Lite BBSs.  You may also purchase  access  to  a  support  section
set up on the original  Nite Lite  BBS,  accessible  by  modem  at
300 or 1200 baud at  (508) 663-4221, or at 2400 baud at (508) 663-
2885.   Information is available  on  that  BBS on how to purchase
access to this support section  as  well  as  information  on  the
purchase of the  Multiline Nite Lite BBS program and the SP series
interface it requires.   Any money you pay  for  registering  this
one-line version as well as any money you pay for  access  to  the
support  section  may  be  deducted  from  your  purchase  of  the
Multiline Nite Lite BBS software.

GETTING IT ON LINE

The first thing you should do once you have unarc'd the Nite  Lite 
BBS  program  is to set up your system the way it will be  set  up 
when  you have callers logging on.   In other words,  set  up  the 
folders  you  will be using and,  if you want to use a  RAM  disk, 
install the RAM disk.  After that, run the INIT.TOS program.

Note that this version of the Nite Lite BBS will require at  least 
a  one-meg Atari ST computer system.   It does not use  the  whole 
megabyte of RAM,  but it does use more than 512K.  You can declare 
a RAM disk of up to 400K bytes.

The sample non-password system that you can create using  INIT.TOS 
consists of just one main menu.   All of the other files generated 
are required for general operation of the BBS.   To understand how 
this BBS operates,  set up your system and run INIT.TOS.   Have it 
generate the non-password main menu.   You may want to make a hard 
copy  of this documentation file so that you have it to  refer  to 
while you are running the BBS program.

Assuming  that  you  have  run  INIT.TOS  at  this   point,   load 
NITELITE.TOS into memory.   Log on using your SysOp name.   If you 
spell it exactly the way you did when running INIT.TOS the  system 
will ask for your password.   This must also be entered exactly as 
it  was  entered  when  running  INIT.TOS.   You  should  then  be 
presented with your SysOp menu, which is very, very terse.  All it 
asks you to do is enter a command.

The  SysOp menu allows complete access to everything on your  BBS.  
Almost any Nite Lite command, including all menu commands and most 
interpreter  commands,   can  be  entered  at  this  prompt.   The 
disadvantage  of  this type of menu is that you do have  to  learn 
some commands in order to do anything.

THE LOGON SEQUENCE

Before  going  through some of the more  commonly  used  commands, 
first review what the BBS just did.  When you first start it up it 
reads  in some of the system files,  then initializes the  message 
base.   When it is ready it automatically logs on your local port, 
which  is  port  0.   The  modem is port 1 and  you  also  have  a 
background port that you can have running,  which is port C.  This 
has  no modem or terminal associated with it but can be  used  for 
background processing tasks.

The  baud  rate detection is skipped on port 0.   On port  1  your 
callers  will have to hit RETURN to initiate the logon.   The  BBS 
uses  this RETURN character to determine the caller's  baud  rate.  
After hitting RETURN,  or immediately,  without hitting RETURN, on 
port 0,  the file LOGON in your main directory is displayed, after 
which the system requests your name.   Enter your name and  verify 
that  you entered it properly by hitting Y at the next prompt  and 
the  BBS  will  see if you have a password.   If  you  do  have  a 
password, the next prompt requests it.  You have up to three tries 
to enter your password correctly.

If  you enter your password correctly,  the password code is  read 
from  the  password  file and logon continues.   If  there  is  no 
password,  a non-password access code is assigned to your call and 
logon  continues.   A  few  statistics are  shown  on  the  screen 
followed by the contents of the file GREET in your main directory.  
If  you have a password and your new message pointer is  not  zero 
you next have the option of reading new messages addressed to you.  
The  very first logon onto your BBS will not generate that  prompt 
since there are no messages on the system.

The main menu is displayed next.   If you have no  password,  this 
will be AMENUZ.   Your SysOp password automatically logs you  onto 
the menu AMENUB.  If you assign other passwords on your system you 
can  control  it so the different callers can log  onto  different 
main  menus.   This  allows you to control the access  of  various 
callers very completely.  The menu names are all AMENU followed by 
an  upper  case letter or a single digit,  so they can  be  AMENU0 
through AMENU9 or AMENUA through AMENUZ.  A caller can access only 
those  function  you  allow on the main menu you  assign  to  that 
caller.

THE PASSWORD CODE

Which main menu a caller sees is determined by the password access 
code,  which is a 14-character string.  The first character in the 
string is the number or letter used to create the name of the main 
menu,  so that character can be a digit (0 to 9) or a letter (A to 
Z).   Remember,  the  letter B is reserved for full SysOp and  the 
letter  Z  is used for the non-password  callers.   The  next  two 
characters are the caller's time limit.   This may be 01 to 99 or, 
for "infinite time," use 00.   This is a per-call time limit.  The 
next  five  characters are the new  message  pointer.   Initialize 
these to five zeroes.   The BBS will use them to keep the caller's 
new message pointer updated.   The next character should  normally 
be a space.   If it is an @ sign the caller (usually just the main 
SysOp)  will  be  able to read (and delete) any  messages  in  the 
message bases,  public as well as private.  If it is an upper case 
letter (this is normally used when a remote SysOp takes care of  a 
particular  section of your BBS),  the caller has SysOp access  on 
the  message  base  designated  by  that  letter.    Message  base 
designators are explained in a later section,  which explains  how 
the message base operates.   The last five characters are  special 
access codes.  They are used only by the L1 command.  This command 
is not often used on BBSs,  and if you don't intend to use it  you 
can use these five characters to store other information.

Your password access code is initially defined as  B0000000@11111, 
which gives you access to the menu AMENUB,  an infinite time limit 
(the 00),  an initialized new message pointer (00000),  SysOp read 
access  on  all  bases (the @ sign) and all  five  special  access 
codes,  in  case  you do have some L1 commands  on  your  BBS.   A 
typical password caller's code may be A4000000 00000, which allows 
them  access to the menu AMENUA with 40 minutes of on  line  time.  
The  new message pointer is initialized to 00000,  no  SysOp  read 
access  is  allowed  (the space character) and  all  five  special 
access codes are "off" (the final 00000).

STANDARD MENUS

The menus on a Nite Lite BBS are in a particular format.  They are 
text  files  and can be entered using commands  available  to  you 
directly from your SysOp menu.   They are executed as text  files, 
which means you do not have to compile them before you put them on 
line.  You can type them directly into the file where they will be 
used by your callers.

A  standard  menu normally starts with a line  containing  exactly 
three  @  signs.   This  is a signal to Nite Lite  that  it  is  a 
standard menu.   That line must be only the three @ signs, with no 
trailing  spaces or other characters.   The very next line in  the 
file  is a list of upper case letters.   These define the  letters 
that  you want to allow on the menu.   Normally these letters  are 
used  to form the prompt at the end of the menu.   If you want  to 
display  your  own  prompt,  put a vertical bar  (|)  followed  by 
exactly the prompt you want displayed at that menu.

Those  initial  two lines are followed by the text  of  the  menu, 
exactly the way you want your callers to see it.  After the end of 
the text,  on a line by itself,  place the word END.   This is the 
code  that  Nite Lite looks for to tell where the  text  ends  and 
where the commands start,  so it must be END,  in all upper  case, 
with no other characters on the line.

Each  line following END contains one Nite  Lite  command.   These 
commands,  defined in detail later in this text, consist of either 
a  letter  followed  by a digit (standard  menu  commands)  or  an 
exclamation point (!) followed by two letters.   Depending on  the 
command,  other information may be appended to either of these two 
forms.

NOTE:   the  word MENU is a reserved word on Nite Lite.   You  can 
call other menus (secondary menus) from your main menu, but do not 
put the word MENU in any part of the name of a secondary menu.  It 
will  not execute it properly because it will "think" that  it  is 
looking for a main menu.  Do not use a folder named "MENU" because 
then  this  reserved  word will become part of  the  name  of  any 
secondary menu that you may place in that  folder.   Also,  always 
use the complete form of the menu name.   Nite Lite looks for  the 
colon  that  follows the drive designator,  so even if  your  main 
drive  is C:\,  Nite Lite may not be able to locate a menu if  you 
call it as "GAMES" instead of "C:\GAMES" - always include the disk 
designator and colon.

AUTOMENUS AND NICS COMMAND FILES

Instead of using the standard hot-keyed menus available under Nite 
Lite,  you can use your own programmed menus.   You can also  call 
your own programs,  written in the NICS (<N>ite Lite <I>nterpreter 
<C>ommand <S>et) language.

Your main SysOp menu is an automenu.  If you look at that file you 
will see that it starts with three exclamation points on the first 
line  (!!!).   The  second line is a file specification  with  /02 
appended  to  the  end.   The third line is the letter  E  all  by 
itself.   This  is  a  very small,  simple  automenu,  but  it  is 
reponsible for allowing you complete BBS access.

When the Nite Lite BBS sees the !!! on the first line of a menu it 
executes it as an automenu.  The next line (the file specification 
with the /02 at the end) is then converted to an M8  command.   M8 
is a "load NICS file" command.   If there is a slash (/)  followed 
by exactly 2 digits,  that many lines are skipped before execution 
begins,  so  this  file is actually calling  itself  and  starting 
execution on the third line.  The third line is just the letter E, 
which is the only one-letter Nite Lite command.  This is immediate 
mode.   You  can  use any standard menu command in  a  NICS  file, 
although they are more commonly used for NICS commands.

For NICS files called using an M8 command you don't use the !!! or 
the file specification.   You can just use M8filespec and the file 
will have the first statement on the first line.   For example, if 
the following file were C:\TESTFILE you would use M8C:\TESTFILE to 
call  it  from a menu.   This file will give you a  random  number 
between 1 and 20 (inclusive):

!RD
!XA+48
!SW
!RD
!XA+48
!AP
!YA/5
!YA+1
!SW
!MS0502
!PRLRandom number between 1 and 20:
!PRA

The  !RD command generates a digit from 0 to 9 and places  it,  in 
binary form, into your A string.  The next command, !XA+48, adds a 
binary  48  to this value to make the number  printable  (standard 
ASCII format for numbers).   !SW swaps the A and B strings so  you 
can  do the same thing again.   At that point,  both the A  and  B 
strings contain some digit in ASCII format.  The !AP appends the B 
string  to  the A string,  which ends up holding a  random  number 
between  00  and 99.   To get it into the 1  to  20  range,  !YA/5 
divides  it  by  5 (putting it into the 0 to 19 range  -  it  uses 
integer division) and the !YA+1 then transfers that to the 1 to 20 
range.   The !Y commands leave the result in a 6-digit form,  with 
the leading zeroes.   To get rid of them,  the !SW puts the result 
into  the B string and !MS0502 takes the partial  string  starting 
with  the 5th byte of the B string,  for two bytes,  and puts  the 
result into the A string.   The !PRL command "prints" out  "Random 
number  between 1 and 20:" and the !PRA "prints" the  contents  of 
the A string,  which is the two-digit random number between 1  and 
20.   After the last command is executed,  the BBS will return  to 
the menu that called the file. 

THE X DISK DESIGNATOR

To  simplify  making menus and text files  "portable,"  Nite  Lite 
recognizes a wildcard disk designator.   If you use X instead of a 
disk drive designator (for example, X:\GAMES instead of C:\GAMES), 
Nite Lite will substitute the last used proper disk designator for 
the X.   In other words, if X:\GAMES is called from a menu that is 
on  drive C,  Nite Lite will look for C:\GAMES.   If it is  called 
from a menu on drive D,  Nite Lite will look for  D:\GAMES.   Only 
the one-letter drive designator is substituted.   Folder names are 
not.   However,  if you are writing a game for Nite Lite,  you can 
put  your entire game into one folder and indicate that,  to  call 
it, you call M8X:\MYGAME\START.  Use the X specifier on every file 
specification in your game.   That way, anyone else wanting to use 
your  game  can  put the folder on any disk and call  it  with  M8 
followed   by   the  proper  disk  designator  followed   by   the 
\MYGAME\START  and the correct disk designator will be  used  when 
the BBS runs the game.

THE MESSAGE BASES

All messages on a Nite Lite BBS are stored in six text files  that 
are  treated  as if they were one file.   Six files  are  used  to 
control  the  message  base  rotation.   All  messages  are  saved 
sequentially, using codes to designate which message base they are 
left  on as well as whether they are public or  private.   Message 
base  files  are  designated as files  A  through  F  (information 
generated by the INIT.TOS program gives them a file stem,  so they 
become  MSGA  through  MSGF unless you change the  .RSC  file  and 
rename  them).   New messages are initially saved to file A  until 
the size of the file exceeds the limit, in bytes, specified in the 
fifth line of the .RSC file.   When that happens, the next message 
saved  is saved to the B file.   This process continues until  all 
six files are full.   At that point,  the next message saved  will 
delete  the  A  file and start a new A file  beginning  with  that 
message.   Effectively,  this  wraps  the base in  sixths  without 
needing message base compression.

The code that determines which base a message is on is called  the 
message base designator.   This is either a space character or  an 
upper  case  letter.   The name is taken from the  BASENAME  file, 
which  is read into memory when the BBS  is  initializing.   These 
names can also be changed by using the !SY command.   In the file, 
the  first  line  is  the  open  base,  designated  by  the  space 
character.   This  is followed by 26 lines,  corresponding to  the 
bases  designated by the upper case letters.   These message  base 
designators are the codes used in the J2, J4, J5 and J6 commands.

CUSTOM MENU COMMANDS

Some functions will be distributed as custom command files.  These 
are  NICS  files called using what looks like  menu  commands.   A 
custom command must be at least two characters long and must begin 
with an upper case letter.   Letters used for standard commands (I 
through N) cannot be used to begin custom menu command names.  The 
second character may be either a letter or a single  digit.   When 
Nite Lite encounters a custom menu command it forms an M8  command 
from it by appending the following information together:   M8, the 
main directory file stem, the first two letters of the command and 
the file extention .NIC.  For example, if your main directory were 
C:\BBS\  and you execute A5,  Nite Lite would try to  execute  the 
command M8C:\BBS\A5.NIC.   Also, if you want to append information 
to a custom command, the entire command is converted to upper case 
and the result is placed into your A string before the M8  command 
is executed,  so you can use interpreter commands to decipher this 
additional information.

STANDARD NITE LITE MENU COMMANDS

The following is a list of all of the standard menu commands  that 
can be executed directly by this software.   You can add  commands 
to this list by using the custom command forms,  but you will need 
to  add  the NICS file to your main directory for  each  of  these 
custom commands.

The standard commands all start with I,  J,  K, L, M or N followed 
by a digit from 0 to 9.  Many of these commands require additional 
information.   Remember that when you append information,  do  not 
add any unnecessary spaces.  Nite Lite reads this information in a 
fixed format,  so a space between the command and,  for example, a 
file  specification appended to it will cause the command  to  not 
properly work.

The available standard menu commands, in alphabetical order, are:

I0  - Send a telegram.   The caller is prompt for the text of  the 
telegram,  which  may be up to 80 charcters in length  (note  that 
longer telegrams can be sent from either chat room),  then for the 
port to send it to.   A telegram is received by the addressed port 
when  the caller in the chat room,  at a menu or in various  other 
places  on the BBS.   A telegram is not received if  the  telegram 
flag is off (see the !TR interpreter command),  when the caller is 
downloading or uploading,  or when the caller is in the middle  of 
entering  a line of text.   Telegrams are also not received  while 
the  caller  is in the middle of a NICS file except  at  an  input 
statement before starting to type.

I1  - Page SysOp.   This sends a telegram to port 0 informing  the 
SysOp that someone has paged.  From port 0, execute I1 followed by 
the port number to call the port into SysOp chat, or from any port 
use the !CH command to call the port into private chat.

I2 - Inquire.   This displays one line per active port showing the 
port number,  caller name,  what the caller is doing and what  the 
callers  current time codes are.   Time codes are time on line  on 
this call, slash, time allowed for this call.  These codes display 
from 00 to 99 or show an asterisk (*) if the value is greater than 
99.   After the list of callers is one line telling the caller  if 
line feeds are off or on on the port calling this  command.   This 
is followed by the time/date line.

I3  -  Monitor.   This must be followed by a  port  number.   This 
allows  you  to  monitor any other  port  on  your  system.   When 
monitoring, you see everything the caller sees as well as all keys 
the caller hits.  In some places this will cause you to see double 
characters  -  you  see the character the caller  typed  plus  the 
character the BBS echoed back to the caller.   You can also  type, 
and the characters you type are read as if the caller typed  them.  
In most places in the BBS, the caller will not be able to see that 
you are typing, but will see the results of what you do.

I4 - SysOp minimenu.   This command first asks you which port  you 
want to access.   Enter the port number followed by  RETURN.   You 
are  then  presented with a list of functions.   Type  the  letter 
corresponding to the function you want.   Do not hit RETURN  after 
this entry.   If the function requires additional  information,  a 
prompt for the additional information will then appear.

I5  -  Terminal  mode  command.   This will  prompt  you  for  the 
port/baud  code.   This  is  a  two-character  entry.   The  first 
character is the port number.   The second is the baud rate  code.  
Codes are 4=300 baud,  5=600 baud,  6=1200 baud, 8=2400 baud and a 
less-than symbol (<) designates 9600 baud.   For example, enter 16 
to call out through port 1 at 1200 baud,  or 4< to call out  using 
port 4 at 9600 baud.  When you hit RETURN at the end of this entry 
you  are in terminal mode.   You can enter a dialing  sequence  to 
call  out.   Press CNTL-X to go to the terminal mode  menu,  which 
allows  you  to  select  various  functions,  including  switching 
duplex,  downloading  or uploading,  dropping carrier on the  port 
you're  using to dial out,  etc.   You can even leave the call  on 
"hold" so that you can return to your BBS for a minute or two, but 
don't forget what port you put on hold or what baud rate you  were 
using because you get back to the call by executing the I5 command 
again and you should enter the same codes.

I6  - Nowhere room.   This command can be forced to  a  port.   It 
basically  does  nothing except echo the charcters  typed  by  the 
caller.   The  caller  cannot  escape from  this  room  except  by 
dropping  carrier.   This function has been used as a "prison"  to 
enforce rules of the BBS.   It cannot be executed for port 0,  but 
port 0 can be used,  via the I4 command,  to force any other  port 
into this room.

I7 - Chat capture.   Actually,  this captures much more than  just 
what happens in the chat room.  It records everything that happens 
on your BBS.   It will prompt you,  if chat capture is off,  for a 
file  specification.   It will open the file and then append  this 
information to the file until you turn off chat capture.   You can 
have  it  append to a file by putting /A at the end  of  the  file 
specification.   If chat capture is already on it will ask you  if 
you want to turn it off.

I8 - SysOp inquire.   This is somewhat like the I2 command  except 
that it gives you much more specific information.   In addition to 
the  port numbers and caller names it also lists information  such 
as the caller's password access code, baud rate and the exact Nite 
Lite command that caller is currently executing.

I9 - Save index.   The message base index is stored just in memory 
and is reestablished when you boot the BBS.  Alternately, you can, 
when you return to the desktop,  use this command,  which writes a 
copy  of  the  index to your main directory using  the  file  name 
INDEX.   When you reload your BBS, while the program is being read 
from  disk,  hold down the R key for a second or two and  the  BBS 
will  reread  this saved index.   On systems with  larger  message 
bases,  this  function  can  save you quite a bit  of  time  since 
rereading  a stored index takes far less time than recreating  it.  
Also,  if  this command is executed from port 0,  it provides  the 
only  "legal" exit from the program.   After saving the  index  it 
issues a prompt asking if you want to return to the  desktop.   If 
you  respond by pressing Y it updates your password  access  code, 
reinitializes  the  SP interface,  then requests  that  you  press 
RETURN.  This RETURN must be pressed on the port 0 keyboard.  When 
you  press RETURN you are returned to the  desktop.   All  callers 
will remain connected,  but since the BBS is not running, will not 
be able to do anything until you reload the BBS program.

J0 - Linked chat room.   Append A,  B,  C or D to this command for 
the  various functions.   J0A is the normal caller entry into  the 
linked chat room.   J0B is the command used to link a BBS to  your 
BBS,  using  your BBS as the host.   J0C is used to link when  the 
other BBS is the host,  but this command is usually  automatically 
executed by the J option on the terminal mode menu.   J0D controls 
the   linked  chat  room  announcement.    J0D00  turns  off   the 
announcement.   Using a value between 01 and 99 instead of the  00 
will cause the announcement to happen at that interval in minutes.  
The announcement must be in a file called CHATSYS located in  your 
main directory.

J1 - Local chat room.   J1 is the normal caller entrance.  Use J1A 
and  your "arrival" and "departure" are not announced.   J1D  will 
trigger  announcements  in  this room in the  same  way  that  J0D 
triggers them in the linked chat room.  The file used in the local 
chat room is LOCSYS.

J2  - Dump messages.   This command first asks the caller for  the 
starting message number.   If the caller has a defined new message 
pointer, a RETURN will assume entry of that value and dumping will 
start  at the message following the highest one read on  the  last 
call.  A /T after the entry of a message number (or just /T if the 
caller wishes to start at the new message pointer) will cause this 
command to dump only those messages addressed specifically to that 
caller.   A J2 by itself will dump messages from the open  message 
base (designated by a space character) on all except callers  with 
a B password access code.  If the caller (the main SysOp, usually) 
uses  J2  by  itself,  the dump will consist of  messages  on  all 
message  bases.   To specify a single or a combination  of  bases, 
append  the  message  base designator(s)  to  this  command.   For 
example,  J2ABC will dump messages from the bases designated by A, 
B  and C and J2 A will dump messages from the bases designated  by 
the space character (open base) and the base designated by an A.

J3  - Log off.   This offers the caller an opportunity to enter  a 
command, which is saved in the LOGOFF file in your main directory, 
then  logs the caller off,  dropping carrier by dropping  the  DTR 
line to the modem.   J3A is an express logoff command, which skips 
over the option of leaving a logoff comment.

J4  - Leave a message.   Append a message  base  designator.   The 
caller can select whether or not the message is  private.   Append 
/N  or /P and the selection of private or non-private is  bypassed 
so you can force a particular base to be either all private or all 
public.   /N forces the message to be non-private and /P forces it 
to be private.

J5  - Read messages.   This command operates exactly like  the  J2 
command with two exceptions.  First, the caller is promted between 
each  message.   This  prompt allows the caller to  abort  reading 
messages, to reply to the message or to go on to the next message.  
Other options are offered in certain conditions.   In addition  to 
the  message number entry options and the base designator  options 
available  in  the  J2 command,  the /N and /P  options  are  also 
available,  used to control the private/non-private status of  the 
replies.

J6 - Scan messages.   This command is identical to the J2  command 
except that only the heading of each message is displayed.

J7  -  Relogon.   The port is returned to where carrier  is  first 
detected.   For  all ports except port 0,  the caller  must  press 
RETURN to reestablish baud rate to log on again.

J9  - Dump text file.   Append the file specification of any  text 
file and that file will be displayed.   At the end of the file the 
BBS requests that the caller press RETURN to return to the calling 
menu.   Append  a  slash  (/) character to the  end  of  the  file 
specification and the press RETURN prompt is bypassed.

K0 - Enter a text file.   Append a file specification.  The caller 
can enter the text file using the standard editor as if entering a 
message.   When  the caller presses S at the final prompt to  save 
the  text,  the  text  buffer is written to disk  under  the  file 
specification designated.

K1 - Change password access code letter.  Append a password access 
code  letter (single upper case letter or a  single  digit).   The 
first  character in the caller's password access code is  changed, 
which changes which main menu the caller will see.

K2 - Download.   Append a file specification.   The file specified 
may be downloaded by capturing or by XMODEM (checksum or CRC,  128 
byte blocks).   The exact file specification must be entered  when 
using  K2  for downloading,  so this command is not  intended  for 
general caller file downloading.  Use N6 for download directories.

K4 - Enter passwords.  This allows entry of caller names, password 
and password codes.   Append a file specification and you can  use 
this  command  to  enter records into  secondary  password  files, 
entering  the file specification in place of the  password  access 
code.

K5 - Upload to file specification.  Append the file specification.  
The  caller  may upload the file using XMODEM (checksum  or  CRC).  
Like  the  K2 command,  this is not intended  for  general  caller 
uploads,  since the exact file is specified.   Instead, use the N7 
command for general uploads.

K6 - List disk directory.   Append a wildcard file  specification.  
The  directory  is read according to that file  specification  and 
displayed  to the caller.   For example,  K6C:\*.* will  list  all 
files and folders in the main directory of drive C, but K6C:\*.NIC 
will display only files with the extention .NIC.

L0  - Line feed switch.   Normally,  callers toggle line feeds  by 
sending a CNTL-L character.  Alternately, you can use this command 
on  a  menu to allow callers to select line feeds by  answering  a 
question with Y or N.

L1 - Special access.   This command uses the last five  characters 
in the password access code.   Append a digit (1 to 5) followed by 
a  file  specification.   If the digit corresponds  to  a  special 
access  code that is "1" the caller will go to the menu  specified 
by  that  file  specification.   For example,  if  the  last  five 
characters in the caller's password code is 01000 an L11C:\SPECIAL 
will  deny  that  caller access to  the  "SPECIAL"  menu,  but  an 
L12C:\SPECIAL will allow access.

L4 - Append text to file.   Append a file specification (note  the 
file  must be an existing text file).   The caller may enter  text 
using the standard editor.   When the text is saved,  the caller's 
name and the time/date line are appended to the file,  followed by 
the text entered by the caller.   Append a slash character (/) and 
the command will skip appending the name and the time/date line.

L5 - Copy file.   If nothing is appended,  the caller is  prompted 
for the "from" and "to" file.   Appending /A to the "to" file  and 
the "from" file is appended to the "to" file.   Alternatively, the 
from and to files may be specified by appending the from  file,  a 
comma and the to file to the L5 command.

L6 - Delete file.   Append the exact file specification.  The file 
is deleted from the disk.

L8 - Edit file.   Append the file specification of a text file  of 
2000  characters  or less.   The standard editor is then  used  to 
alter the text,  which can then be saved,  replacing the  original 
file.

L9 - Questionnaire.  This command requires two file specifications 
separated  by a comma.   Each line in the first file specified  is 
used  as a question.   The caller answers each question  with  one 
line  of input.   At the end,  the caller is given the  option  of 
saving the responses.   If the caller presses Y, the caller's name 
followed  by the answers,  in the order they were  presented,  are 
saved to the text file followed by a blank line,  which serves  to 
separate the responses.   Note that both files must exist prior to 
calling this command.

M4  - Battle menu.   This calls up a 3-function menu  that  allows 
callers  to  "do battle" when the adventure  flag  is  set.   This 
command is automatically implemented when the M5 command sets  the 
adventure  flag,  but  can  also be specified  explicitly  from  a 
command file.

M5 - Toggle adventure flag.   When the adventure flag is on,  each 
secondary  menu automatically gets an extra  function,  using  the 
letter  Z,  which brings up the battle menu.   The caller is  also 
informed when entering the menu if there is another caller on  the 
system who is also at that menu.   Hitting Z automaticaly executes 
an M4 command.  The "battling" uses the remaining time on line for 
this  call  as  the  "energy" and callers who  use  up  energy  by 
"hitting"  too  many times or being hit too many  times  will  get 
timed out.

M6   -  Random  load.    Append  a  single  digit  and  two   file 
specifications separated by a comma.  A random digit is generated.  
If  the  generated random digit is greater than the digit  in  the 
command the first file specified is loaded as a  menu.   Otherwise 
the second file specified is loaded as a menu.

M8 - Run command file.  Append the file specification of a command 
file  (NICS  file).   You  may also append a  slash  charcter  (/) 
followed  by  two  digits  to skip that  number  of  lines  before 
starting execution.

M9 - Secondary password access.   Append the file specification of 
a  secondary password file.   This secondary password file  is  in 
exactly  the  same  format as the main password  file  except  the 
password  access code is replaced by the file specification  of  a 
secondary menu.   If the caller's name is found in this file,  and 
the  caller  enters the correct password,  the file  specified  is 
loaded as a standard menu.

N1 - List free space on disk.   Since GEM hogs the computer  while 
this command is executing,  and the command could take a while  on 
hard  drives,  this function was not included in the  K6  command.  
The free space,  expressed in K,  is displayed.   Append the  disk 
designator (one letter) to this command.

N2 - XMODEM download listed files.   Callers can add files to  the 
list when using the N6 command.   This command can be executed  at 
the caller's option when exiting the N6 command or you can list it 
on a menu so that the caller may download the list of files  later 
during that session.

N3  - Delete empty folder.   Append the folder path,  without  the 
trailing backslash, and if the folder is empty it will be deleted.  
For  example,  to delete the folder "SPECIAL" on  drive  C,  first 
delete all files in the folder, then use N3C:\SPECIAL.

N4 - Create a folder.  Append the folder path, as described in the 
N3 command.

N5  -  Edit  transfer index.   Append the folder  stem  (the  path 
including  the trailing backslash) of a properly  configured  Nite 
Lite file transfer folder.   This command will allow you to review 
the  uploaded  file names and descriptions from the  UINDEX  file, 
transferring the entries of files that you want callers to be able 
to  download into the DINDEX file.   Note that,  to set up a  Nite 
Lite  file  transfer  folder you  must  create  the  folder,  then 
initialize  (use the !DI command) a file in it called  UINDEX  and 
one  called DINDEX.   Files uploaded using the N6 command will  be 
indexed in the UINDEX file and the N7 command will list the  files 
indexed in the DINDEX file.   Note that the N5 command will create 
a work file,  TINDEX, in that folder.  When not actually executing 
an N5 command, this file is not used and can be deleted.

N6 - User upload.  Append the path to the file transfer directory, 
as  described in the N5 command.   The file may be uploaded  using 
XMODEM  (checksum  or CRC).   If the upload is  successful  it  is 
indexed in the UINDEX file.

N7  -  User  download.   Append  the path  to  the  file  transfer 
directory,  as described in the N5 command.  The caller is shown a 
list  of files available,  taking this list from the DINDEX  file.  
To  create a system where callers can download anything  uploaded, 
which  eliminates the possibility of checking the files  but  also 
eliminates the need for using the N5 command,  append a slash  (/) 
character  to  the end of the path and this command will  use  the 
UNIDEX file instead of the DINDEX file.

N8 - Rename file.  Append the full file specification of the file, 
a comma, and the new file specification of the file.  This command 
will change the name.   Files can be moved to a folder or the main 
directory, from a folder or the main directory providing that both 
file specifications are on the same logical drive.   For  example, 
N8C:\SPEC\FILE1,C:\ZCODE  will  move  the file FILE1  out  of  the 
folder SPEC to the main directory on drive C.

N9  - Paged text file read.   Append the file specification  of  a 
text file.   The contents of the file are sent 20 lines at a  time 
with  a prompt at the end of each 20 lines allowing the caller  to 
continue reading or to abort reading.

E  -  Immediate mode.   Nothing can be appended to  this  command.  
This must be E on a line by itself.   This is the command used  on 
the main menu to bring up the prompt "Enter command:  " and allows 
entry  of almost any Nite Lite command.   The command  entered  is 
immediately executed.

filespec  -  Load menu.   This command is used to  load  secondary 
menus from other menus or from an E command.  Simply list the file 
specification as if it were a command.   Always use the full  file 
specification - Nite Lite identifies this command from all  others 
by  looking  for  the colon (:) as the  second  character  in  the 
command.

NITE LITE INTERPRETER COMMAND SET (NICS)

All  interpreter  commands  consist of an  exclamation  point  (!) 
followed  by  two  upper  case  letters.   Some  commands  require 
additional information following this.   This is a terse  language 
and is in fixed format,  which means that a space is considered  a 
character and does count as one in the command.   For example, the 
command !STAx and the command !STA x are different.   One will put 
the single character x into the A string and the other will put  a 
space character followed by an x into the A string.   The  command 
!ST Ax is invalid and will not be interpreted properly.

Most  NICS  commands can be executed from a menu as if  they  were 
menu commands.  Exceptions to this are the text file commands like 
!DO,  !DR,  etc.,  and  the  obvious ones such as  jump  commands.  
Although  most  of them are executable as menu commands  they  are 
intended for use in interpreter command files.  These files can be 
executed  by  using  an  M8 command on  a  menu  or  from  another 
interpreter  command  file,  by using an automenu,  by  using  the 
alternative LOGON file format,  by using the alternate GREET  file 
format or by using custom command calls.

The M8 command executes the file directly.   The form is simply M8 
followed  by  the complete file specification of  the  interpreter 
command file.  If the M8 command is in an interpreter command file 
execution of that file is terminated and the new file takes  over.  
When the end of the command file is encountered,  the system  will 
return  to the most recently executed menu unless that  definition 
is changed by menu calls within the command file.

An automenu simply creates an M8 command.   The automenu  consists 
of  only  two  lines  with !!!  on the first  line  and  the  file 
specification on the second line.   The file specification is used 
to  form  the M8 command and no menu is actually  shown.   The  M8 
command  does  have  a / option.   If you  append  a  /  character 
followed  by a two-digit number to the  file  specification,  that 
number  of lines will be skipped before  execution  begins.   This 
option can be used in any function that results in execution of an 
M8 command.

The  alternate LOGON sequence is initiated if LOGON begins with  a 
single line containing three exclamation points.   This causes the 
LOGON  file to be interpreted as an automenu,  so the second  line 
must  be a file specification.   This file specification  is  then 
used  to  form an M8 command.   The file must  replace  the  logon 
sequence,  defining the user name,  time on line,  password access 
and everything else you need to define for each user logging  onto 
your BBS.

The alternate GREET sequence works differently from the  alternate 
LOGON sequence.   This option must be in place when you boot  your 
BBS initially.   The name of the GREET file must end with "NIC" as 
the last three letters of the file name.   If it does, immediately 
after  verification of the name during the normal logon  sequence, 
this greet file will be executed as a command file.  Note that, at 
this  point,  the  user's time and password access  has  not  been 
defined so the command file must take over those tasks.

All defined menu commands consist of the letter I, J, K, L, M or N 
followed  by a single digit.   Alternate menu commands must  start 
with  any  other  upper case letter  followed  by  one  additional 
character that is legal in a disk file name.  These two characters 
are  used  to  form a file specification that  is  executed  as  a 
command file.   Note that this is not formed into an M8 command so 
the   /  option  is  not  available  in  this  form.    The   file 
specification formed is the default disk directory stem (from  the 
.RSC  file)  followed by the two characters followed by  the  file 
extention .NIC.   For example,  executing A5 results in  executing 
the  file  C:\A5.NIC if your main directory is  declared  as  C:\.  
Note  that the second character may not be a colon (:) since  that 
will   cause  Nite  Lite  to  look  at  the  command  as  a   file 
specification and it will attempt to load it as a menu.

Interpreter  commands  are  designed to  work  with  string  data.  
Available  to  each  port  are  two  working  strings,   both  255 
characters in length, identified as the A and B string, as well as 
a stored string array of ten elements identified as stored strings 
0 to 9.   In addition there is one boolean variable that is set by 
various commands and used to branch on the results of comparisons, 
disk commands and error conditions.  In addition there is a set of 
ten  system strings identified as system strings 0 to 9  that  are 
common  to  all ports.   System variables are also  accessible  to 
interpreter commands.  These system variables include the time and 
date line,  caller name,  baud rates being used at various  ports, 
all  lines in the FIFO buffers used in both chat rooms  and  other 
variables  used by the system for control.   Most of these can  be 
read and changed by interpreter command files.

Comments  can  be imbedded into the code  in  several  ways.   The 
simplest and most common way to do this is to use the !NO  command 
(no operation).   Anything can be appended to that command and the 
appended line is ignored by the interpreter.  Comments can also be 
appended to many other commands as well.   The only commands where 
comments may not be appended are commands that require a  variable 
amount of information.   For example,  !STA may not have a comment 
appended  because everything between the A and the RETURN  at  the 
end  of the line is transferred to the A  string.   Commands  like 
!DRA (or !DRB) may be followed by a command.   When in doubt as to 
which  commands may be followed by comments,  write a  short  test 
file first to see how the command in question responds to having a 
comment appended to it.

There  are  appended functions that can be used  with  interpreter 
commands.   The @ function works with interpreter commands in  the 
same  way  it  does with menu  commands,  placing  all  characters 
following that symbol into the port's input buffer.   The &  sign, 
not  available  to  any  menu  commands  except  M8,   causes  all 
characters  following  the & symbol into the A string  before  the 
command  is executed.   One of the more common places where the  & 
function  is  used  is in the !PLA function so  that  an  explicit 
prompt  line can be placed into the code using a  single  command.  
For  example,  !PLA&What  is your name?  will send "What  is  your 
name?"  to the caller and will leave the cursor on the same  line.  
The last appended function,  the | function,  will also operate on 
all  interpreter  commands in the same manner as it  does  on  the 
standard menu commands.

When   using  appended  functions  on  appended   commands   their 
interpretation  may  not  be immediately  obvious.   Many  of  the 
interpreter  command  allow or require that a  second  command  be 
appended.  The appended function will be executed before the first 
of the appended commands is executed.   The !CE command will  also 
operate  on  any  &  sign  appended  in  as  data.   For  example, 
!CE"!STA"+B+S2 will, if S2 contains an & sign, place things in the 
A  string  immediately prior to when the concatonated  command  is 
executed.   This  could  cause  problems if  the  !CE  command  is 
operating   on   data  resulting  from   computations   if   those 
computations could result in generation of a & or @ sign.

When  writing  interpreter  files,   remember  that  this  is   an 
interpreter  and is therefore not an impressively  fast  language.  
Therefore, particularly in longer interpreter files, the code must 
be  optimized  as much as possible.   Once you  have  written  and 
tested  an interpreter file,  review the file and look for  places 
where  you  can  make alterations to make  the  file  run  faster.  
Changes  are constantly being made to the program itself  to  help 
these interpreter files operate more quickly,  but with 5, 9 or 11 
partitions competing for CPU time, there is a limit to how quickly 
these interpreter commands can operate.

The  name  NICS  is  an acronym  for  (N)ite  Lite  (I)nterpretive 
(C)ommand (S)et.   This is a constantly expanding set of  commands 
that can be used in all interpreter files.   The list that follows 
is a complete list of all NICS commands, in alphabetical order, as 
of May 24, 1989:

!AF  -  Append to file.   Append A or B followed by  a  full  file 
specification  to  this command.   The contents of  the  indicated 
string  are appended to the end of the indicated disk  file.   The 
line  is  written with only a RETURN character at the end  but  no 
line  feed making the file incompatible with many word  processors 
and text editors.   For compatibility you can first append a  line 
feed character then use !AP.   The line feed is not required under 
Nite  Lite,  which will read the line properly whether or not  the 
line feed is present.

!AP - Append.   No appended information is required.  This command 
appends the B string to the A string,  truncating the result if it 
is longer than 255 characters.   The contents of the B string  are 
not altered by this command.

!BC - Binary convert.   The contents of the A string are converted 
to a binary number,  stored as a single byte in the A string.  The 
number to convert must be a 3-digit ASCII formatted number in  the 
range 000 to 255.

!BD  - Binary to decimal.   This is the complimentary function  of 
!BC,  converting the first byte of the A string to a 3-digit ASCII 
format  number.   This  3-digit number is stored back into  the  A 
string.

!BF  - Blank fill.   Spaces are appended to the A string,  if  the 
length of the A string is less than 80 characters,  to make the  A 
string 80 characters in length.

!BL  - Block.   This is actually a series of commands designed  to 
allow direct access to the 2K buffer available to each port.  This 
buffer is used in menu commands for text entry,  file copying  and 
other  functions.   The block commands can be used to act on  data 
that  resulted from these menu commands or it can use  the  buffer 
for  purposes not related to the menu commands.   There  are  also 
other  functions built into the block commands that  allow  direct 
communication with the port, bypassing the normal system character 
masking  functions.   This makes it possible to add file  transfer 
protocols that are not available through the menu  commands.   The 
block access commands, in alphabetical order, are:

!BLC - Block close.  This closes any file opened for block access.  
See also the !BLO command.  CAUTION: Close ONLY the files that you 
OPENED.   If  this command is used to close a file when none  were 
opened, some very strange things can happen to your port 0.

!BLF  -  Transfer  from A to block.   Append  an  ASCII  formatted 
number.  The contents of the A string are transferred to the block 
starting  at  that  offset.   Note that the command  will  not  be 
executed at all if the total of this number plus the length of the 
A string is greater than 2000.

!BLG - Get characters.   This command does not use the 2K block at 
all but instead takes all characters awaiting input at the port to 
be read into the A string without translation (i.e., no masking of 
any of the characters).

!BLO - Block open.   This will open any file on your disk.  Append 
a  single digit followed by a file specification.   This  accesses 
the  GEM  f_open command directly,  using the digit  as  the  mode 
number.   Modes  are read only (0),  write only (1) or  read/write 
(2).  The A string is not affected by this command.

!BLR - Block read.  This accesses the GEM f_read command directly.  
Append  a one- to four-digit ASCII formatted number  between  0001 
and 2000.  This number is used as the number of characters to read 
from  the  currently opened file.   Characters are read  into  the 
buffer.   The number of characters actually read may be less  than 
the  number  requested if the end of file was encountered  so  the 
number returned by the command is placed into the A string.

!BLS - Block seek.   This command can do a number of  things.   It 
directly accesses the GEM f_seek command.   Append a  single-digit 
mode number (0=from the beginning of the file,  1=relative to  the 
current  position  in  the file or 2=from the  end  of  the  file) 
followed by a one- to six-digit ASCII formatted number to be  used 
as the offset.   Note that this number must be a positive  number, 
which does restrict the use of f_seek a little.   The command sets 
the file pointer at the indicated location and returns the current 
offset value, as measured from the beginning of the file, in the A 
string.   This  allows the command to not only position  the  file 
pointer  but  also allows it to return the value  of  the  current 
position or the exact size of the file.

!BLT - Transfer to the A string from the block.   Append an  ASCII 
formatted  one-  to  four-digit number to  indicate  the  starting 
position,  within the block.  You can also append a comma followed 
by another ASCII formatted number if desired.  The first number is 
used  as  the starting position and must be in the range  0001  to 
2000.   Characters are taken from that point in the block.   If no 
second  number  is indicated in the command,  255  characters  are 
copied  from the block into the A string.   If a second number  is 
given in the command,  that second number is used to determine the 
number  of  characters copied into the  A  string.   For  example, 
!BLT0001 will copy the first 255 characters (starting at  position 
1)  to  the A string,  making the A string  255  characters  long.  
!BLT0001,00200 will copy 200 characters, starting at position 1 in 
the block,  into the A string,  resulting in the A string having a 
length of 200 characters.

!BLW  -  Block write.   This is direct access to the  GEM  f_write 
command.   Append  a  one- to four-digit number  to  indicate  the 
number  of characters to write.   The characters are written  from 
the  block,  starting at position 1,  to the current file  pointer 
position in the currently opened block access file.  The number of 
characters actually written is returned in the A string.

!BLX  -  Block  transmit.   Append  two  ASCII  formatted  numbers 
separated  by a comma.   The first number is used as the  starting 
position  within  the block and the second number is used  as  the 
ending position (NOTE:  NOT the length,  but the ending position).  
No  more than 200 characters may be sent by this command,  so  you 
need multiple !BLX commands to send longer blocks to a port.   The 
characters are sent without any masking or translation.

!BLZ  -  Calculate  CRC.    Append  two  ASCII  formatted  numbers 
separated by a comma.   These are used as the starting and  ending 
locations  for the CRC calculation (NOTE:  Neither is a  length  - 
both   are  positions  within  the  block).    The  two-byte   CRC 
calculation  is  returned in the A string as well as  in  the  two 
bytes in the block following the position indicated by the  second 
number given.   For example,  !BLZ0001,1024 is executed,  the two-
digit  CRC calculation is returned in the A string as well  as  in 
the block in positions 1025 and 1026. 

The  block  access  commands are intended to  give  you  low-level 
access to the disk and the modem.  Note that there is no "open new 
file" command.   If you want to open a new file and use the  block 
access  commands to place data within the file,  first use !DI  to 
initialize the file, then !BLO followed by !BLW to write to it.

!BU - Blank unfill.   This is the inverse of the !BF command.   It 
will strip off any trailing blanks from the A string.

!CC - Set password access code.  This must be followed by at least 
14 characters.   Whatever is appended to this command becomes  the 
caller's password access code.

!CE  -  Concatonate  and execute.   Append a  series  of  elements 
separated by + signs.   The elements are appended together and the 
result  is  executed  as a command.   Elements may be A  or  B  to 
indicate the A or B string,  S0 through S9 to indicate the  stored 
strings,  L  for the selected chat line length,  N for the  caller 
name,  P for the port number,  R for the baud rate, T for the time 
and date line or a literal enclosed in double quotation marks (").  
For  example,  !CE"!PRLLogging on port "+P+" at "+T   inserts  the 
port number and the time/date line, just as it appears before main 
menus,  and sends the resulting string to the caller.   Note  that 
this will not affect the contents of either the A or B strings.

!CG  - Compare greater.   The A and B strings are  compared.   The 
compare  flag  is  set true if A>B or false  if  A<=B.   The  full 
strings are compared.

!CH - Chat.  Append a port number.  This is a remote chat call and 
will pull the indicated port number into a SysOp chat "room"  that 
operates  much like the chat room accessed using the  I1  command.  
The calling port may terminate chat by sending a  CNTL-X.   Append 
an  A after the port number and either caller may terminate  chat, 
allowing use of the command as a caller-accessible private chat.

!CI  -  Command interface.   Set up the A string  to  contain  the 
string to send to the interface before executing this command  and 
append a one-digit number to this command.   The string is sent to 
the interface and, unless the appended digit is a zero, the system 
waits  for the number of characters indicated by this digit to  be 
returned from the interface.  The bytes received are stored in the 
A string,  replacing the original contents.  Exercise caution when 
using  this command.   If more characters are indicated  than  the 
number actually returned by the command sent it could lock the ST.  
If  fewer  characters  are  indicated  than  the  number  actually 
returned, very unpredictable results could follow.

!CK - Checksum.   This calculates a two-byte checksum of the bytes 
in  the B string (sum of all ASCII values of  the  character,  mod 
256) and places the result (in low-high order) into the first  two 
bytes of the A string.

!CM - Compare minus.   The A and B strings are compared,  using  a 
full-string compare.   If A<B the compare flag is set  true.   The 
compare flag is set false if A>=B.

!CP  -  Single character compare.   Append A or B  followed  by  a 
single character.  The first byte of the A or B string is compared 
to that single character and the compare flag is set true if  they 
are equal or false if they are not.

!DC  -  Close text file.   This command will close  any  currently 
opened text file.  If none are open, this command will do nothing.  
Note that returning to a main menu, logging off or opening another 
text file will also close the currently opened text file.

!DF - Find file.   Append a full file specification.   The file is 
located on the disk and the file specification given,  followed by 
the size of the file in K,  is returned in the A string.   If  the 
file is not located, the A string is returned empty.

!DI - Initialize file.   Append a full file specification.   A new 
file  is  opened as indicated,  deleting any file  that  may  have 
existed under that file specification.

!DO - Open disk file.  Append a full file specification.  If there 
is a text file currently opened by the port executing this command 
it is closed first, then the system attempts to open the indicated 
file.   There  is  no error message available on  this  statement.  
After executing this command,  if the first !DR statement  results 
in  an end-of-file condition either the file does not exist or  is 
an empty file.

!DR - Disk read.  Append A or B.  The next text record is read and 
placed  into the A or B string.   The file pointer is set  as  the 
beginning of the record read so that it can function to update the 
text record with no positioning command prior to the !DW command.

!DS - Disk seek.   Append a full file specification.   The size of 
the  indicated file,  in bytes,  is returned as an  8-digit  ASCII 
formatted  number in the A string.   If the file doesn't exist  it 
returns with A as an empty string.

!DW - Disk write.   Append A or B.   The contents of the indicated 
string  are  written  to the currently opened  text  file  at  its 
current file pointer position.   The record is written with only a 
RETURN character,  not a line feed followed by RETURN, which could 
cause  problems  if the file is then read by a word  processor  or 
text editor.   You can append a line feed before you do the !DW in 
order  to make the file compatible with word processors  and  text 
editors  but  the line feed is not required if the file is  to  be 
used only by Nite Lite.

!EQ - Equal.   This full-string compare sets the compare flag true 
if string A is exactly equal to string B or false if they are not.

!EX  -  Execute  string.   Append A or B.   The  contents  of  the 
indicated string are executed as a command.

!FA - Find with AND option.   Append A or B followed by a  string.  
The indicated string is searched.   If the appended string is  not 
found  within the indicated string the compare flag is set  false.  
If it is found the compare flag is not altered.

!FI - Find.   Append A or B followed by a string.   The  indicated 
string  is searched.   If the appended string is found within  the 
indicated  A or B string the compare flag is set true.   If it  is 
not found the compare flag is set false.

!FO  - Find with OR option.   Append A or B followed by a  string.  
The indicated string is searched.  If the appended string is found 
within the indicated A or B string,  the compare flag is set true.  
If it is not found, the compare flag is not altered.

NOTE:   To use !FA or !FO for the AND and OR options,  use !FI for 
the first compare,  then !FA or !FO for the second  compare.   For 
example,  to test if either "this" or "that" is contained in the A 
string,    execute   !FIAthis   then   execute   !FOAthat.    Four 
possibilities  result  from  whether or not "this"  is  found  and 
whether  or not "that" is found.   Following the logic of  setting 
the compare flag through these two commands, the compare flag will 
be  set  to  true unless both compares fail,  in  which  case  the 
compare flag will be false.   To test for both (the AND  function) 
use  !FA  instead of !FO and the compare flag will  be  set  false 
unless both compares succeed.

!GT - Get.  This command has several forms:

!GTA  or  !GTB followed by a stored string number  will  copy  the 
contents of the stored string to the indicated A or B string.

!GTC  followed  by a port number sets the A string  equal  to  the 
command being executed at the indicated port when this command  is 
executed.

!GTN followed by a port number sets the A string equal to the name 
of the caller logged onto the indicated port.

!GTT followed by a port number sets A equal to the time codes from 
the  indicated port.   Two bytes are returned and they are  binary 
values.   The  first byte is the time limit of the caller  at  the 
indicated  port and the second byte is the number of minutes  that 
caller  has  been on line.   If either value is  greater  than  99 
minutes, the byte is set to the binary value 100, so 100 indicates 
over 99 minutes.

!GTZ followed by a port number sets the A string equal to the chat 
name  (name selected by /n in the local chat room) of  the  caller 
logged onto the indicated port.   If the caller has not used /n to 
declare a chat name the callers logon name is returned.

!GV - Get system variable.  Append a single digit and the A string 
is set to the contents of the indicated system array string.

!HG - Hog.   Sometimes it is necessary to run several  interpreter 
commands without allowing any other port to operate,  such as when 
updating  a  file.   Executing  !HG will give  the  port  complete 
control  of  the system until a !UG command is  executed.   A  !UG 
command  is  automatically executed if the port times out  or  the 
caller drops carrier when !HG is being executed.

!HR - Input from port.  Append a port number.  This command can be 
used to control another port.  It will wait for a complete line of 
input  from  the other port.   This command is intended  for  such 
things as programmed links and should not be used to wait for user 
input.   There  is no "escape" from this command if the caller  on 
the indicated port drops carrier, times out or simply never hits a 
RETURN character.  The entered line is returned in the A string.

!HW - Write to port.  Append a port number.  The contents of the A 
string  are  written to the indicated port.

!IE  -  If equal.   Append a single character followed by  a  full 
command.   If the character is equal to the first character of the 
A string, the appended command is executed.

!IF - If false.   Append a command.  If the compare flag is false, 
the appended command is executed.

!IN - Input.  Append A or B.  The system will wait for a full line 
of input,  which is stored in the indicated string when the caller 
presses  RETURN  (or a RETURN is issued automatically  because  of 
word wrap).

!IS - Insert string.   Append a single digit.  The contents of the 
A string are inserted into the B string at the position  following 
that  indicated  by the appended digit.   For example,  if  the  A 
string  contains AAA and the B string contains  BBB,  the  command 
!IS2 results in the B string equalling BBAAAB.

!IT - If true.   Append a command.   If the compare flag is  true, 
the appended command is executed.

!JL - Jump to label.   Append a label.   The search proceeds  from 
that  point  toward  the  end  of the  file  for  a  matching  !LL 
statement.   If  the  label  is not found,  an  error  message  is 
displayed and the caller is returned to the menu.

!JP - Jump.  Append a digit.  Execution is transferred to the last 
executed  matching !MK command within the command  file  currently 
being executed.   The matching !MK command must have been executed 
for  the  !JP  command to operate properly unless  using  !JP9  to 
return from a subroutine called from a !JS command.  Note that !JP 
must NOT be the last statement in a command file.   When the  last 
statement is read in, the command file is closed and the file must 
be  open  in order to properly execute !JP.   If !JP is  the  last 
logical  statement in a command file,  place any other command  on 
the line following the !JP.

!JS  -  Jump to subroutine.   This is a  non-recursive  subroutine 
jump.  The subroutine must exist between the !JS statement and the 
end of file.  Append a label to this command.  The subroutine must 
begin  with  a  matching !LL statement and must end  with  a  !JP9 
command.   This  subroutine  jump command acts like !MK9  and  !JL 
command all on one line.

!LA or !LB - Length test.   Append a single digit.   If the length 
of  the  indicated A or B string is greater than or equal  to  the 
appended  digit,  the  compare flag is set true.   If  the  string 
length is less, the compare flag is set false.

!LL  - Label.   Append a label.   This command is used to  mark  a 
location  to  be used by a !JL or  !JS  command.   The  characters 
between the !LL and the RETURN at the end of the command line  are 
compared to the chararacters between the !JL or !JS and the RETURN 
at the end of that command line and must be exactly equal.

!LN  - Length.   The length of the B string is stored as a  single 
binary digit in the A string.

!MK  -  Mark.   Append  a single  digit.   When  this  command  is 
executed,  it  marks  a location that can be branched  to  with  a 
matching !JP command.

!MS - Midstring.  This command sets the A string and sets it equal 
to a portion of the B string.  It has several forms.  At least two 
digits,  S  followed by a single digit or NN (two upper case  N's) 
must be appended to indicate a starting location.   Two additional 
digits  may be appended to indicate a length.   A single S may  be 
appended,  which causes the extracted characters to be taken  from 
the B string.   The way these various options are interpreted  are 
explained in the following examples:

!MS0203  sets the A string equal to the second,  third and  fourth 
characters of the B string.  The B string is not altered.

!MSNN  sets  the A string equal to the B string  starting  at  the 
location  where the string was found in the last !FI,  !FA or  !FO 
command.  Since no length is given, all characters from that point 
to the end of the B string are copied to the A string.

!MSNNS  is exactly the same as the !MSNN command except  that  the 
characters  copied  are  also removed  from  the  B  string.   For 
example,  if  NN indicates that the last !FI,  !FA or !FO  command 
found the string at position 3 and B were equal to abcdefg,  the A 
string  would be set equal to cdefg and the B string would be  set 
equal to ab.

!MSS203 sets the A string equal to the characters of the B  string 
starting  at  the  position indicated by the  first  character  of 
stored string two plus the two characters following that position.

!PG  - Pointer get.   The position of the first character read  by 
the  last  executed !DR,  !SE or !SF command is stored  in  the  A 
string as a six-digit ASCII format number.

!PI - Push.   This sets up the system strings as a 9-element  FIFO 
stack using system string 0 as a "head" pointer.  !PI pushes the A 
string  onto  this "stack" and increments the  pointer  in  system 
string 0.

!PL - Prompt line.   Append A or B.   The indicated string is sent 
to  the port with no RETURN character so that it can be  used  for 
things like prompts for questions.

!PR  -  Print.   This  command has  several,  "printing"  what  is 
indicated  by  sending  the  information,  followed  by  a  RETURN 
character, to the port.  These various forms are:

!PRA sends the contents of the A string.

!PRB sends the contents of the B string.

!PRL  is  a  "print immediate" form.   Append  the  string  to  be 
printed.

!PRN prints the caller's name.

!PRT prints the time and date line.

!PS - Pointer set.   This is the inverse of the !PG command.   The 
contents  of  the A string are interpreted as an  ASCII  formatted 
number  and is used to set the file pointer in the currently  open 
text file.

!PT - Put.  Append A or B and a digit.  The contents of the A or B 
string  are copied to the indicated stored string.   For  example, 
!PTA3  will copy the contents of the A string to stored string  3.  
There are also other forms of the !PT command:

!PTL copies the A string to the autologoff command.   The A string 
must contain the command to be executed when a caller times out.

!PTN  copies  the  A  string  into  the  caller's  name  variable, 
changing the caller's logon name.

!PTZ copies the A string into the caller's chat name variable.

!PV - Put to system array.  Append a single digit and the contents 
of the A string are copied into the indicated system array string.

!RD - Random digit.   This puts a random digit (0 to 9) into the A 
string.

!RN - Random compare.   Append a single digit.   A random digit is 
generated.   If  the random digit is less than the appended  digit 
the compare flag is set true.   Otherwise, the compare flag is set 
false.

!SB - Strip byte.   Append a single digit.   The digit is used  to 
indicate  the  position  of a character in  the  B  string.   That 
character  is removed from the B string.   For example,  if the  B 
string  contained abcde,  executing !SB4 would leave the B  string 
equal to abce.

!SC  -  Strip character.   Append a character.   The B  string  is 
searched  for  the  matching character.   If  it  is  found,  that 
character  is  stripped  from the B  string.   If  that  character 
appears more than once,  the first occurrence of the character  is 
the one stripped from the string.   For example, with abcde in the 
B string, executing !SCc would leave abde in the B string.

!SE - Search equal.   Append A or B and a full file specification.  
The  file indicated must be a text file.   It is searched for  the 
first  occurrence of a string exactly equal to the A or B  string, 
as indicated.   If it is found,  the file is left open, positioned 
at the line following the line containing the string exactly as if 
a !DR command had been executed (i.e.,  a !PG will get the pointer 
indicating  the beginning of the line containing the  string)  and 
the  compare flag is set true.   If it is not found,  the  compare 
flag is set to false and the file is closed.

!SF - Search for.   Append A or B and a file specification.   This 
is identical to the !SE command except that,  instead of searching 
for a line exactly equal to the indicated A or B string,  the A or 
B  string  is used to search each record in the  text  file.   The 
search  completes  at the first line in the file that  contains  a 
match of the contents of the A or B string.

!SG - Get system variable.   This command reads particular  system 
variables.   The results of the !SG command are returned in the  A 
string.  The forms of this command are:

!SGB gets the baud rate code.  This will be a binary character and 
will be equal to 4,  5, 6, 8 or C to indicate, in that order, 300, 
600, 1200, 2400 or 9600 baud.

!SGC  gets  the number of characters waiting for  input  from  the 
modem.  This is returned as a one-digit binary number.

!SGD  gets the download count.   Each time a file is  successfully 
downloaded this number is incremented.

!SGL  sets the A string to a binary 1 if the line feeds are on  at 
that port or to a binary 0 if the line feeds are off at that port.

!SGM  sets the A string equal to the highest message  number  that 
has been read by the caller.   When the caller first logs on, this 
is  equal to the new message pointer in the password  code.   When 
the caller logs off, this number is used to update the new message 
pointer before it is resaved to the password file.

!SK  - Scan key.   Append A or B.   If a character is waiting  for 
input it is placed into the A or B string and the compare flag  is 
set to false.  Another command may be appended to this command and 
if it is,  that command will be executed if a character is waiting 
when  the  !SK  command is executed.   If there  is  no  character 
waiting  for  input the contents of the indicated string  are  not 
changed  and  the compare flag is set false.   In  this  case  any 
appended command is ignored.

!SL - Skip lines.   Append a digit.   The number of lines equal to 
the  appended  digit  are skipped in  the  file  before  execution 
resumes.

!SP  -  System  put.   This is the inverse  of  the  !SG  command.  
Information in the A string are written to a system variable.  The 
various forms of this command are:

!SPD writes to the download count.

!SPL writes to the line feed flag.

!SPM writes the number of the highest message read.

!SPN writes to the upload count.

See  also the !SG command for the various formats  required.   The 
information written by the !SP command must be in the same  format 
as the information read by the !SG command.

!SS  - Set screen.   There are three formats for this command  all 
relating to the screen width controls used in the two chat  rooms.  
The  screen width is used to control the formatting of  the  lines 
sent back to the caller from the chat rooms.  The three formats of 
this command are:

!SS? returns the current screen width to the A string.

!SS00 turns off the screen width so that no formatting is done  on 
lines sent to the caller in the chat rooms.

!SS followed by a 2-digit number between 36 and 99 set the  screen 
width to that value.   Any number below 36 will be interpreted  as 
if the number were 00, turning off the screen width.

!ST - Store.  This command has several forms, which are:

!STA and !STB requires that a string be appended.   The string  is 
stored in the indicated A or B string.

!STD sets the day number in the SP interface's real time clock.  A 
two digit number must be appended to this command.

!STF requires an appended port number followed by a  digit.   This 
command  will  set  the  A  string  equal  to  the  stored  string 
(indicated by the digit) of the indicated port.   This allows  any 
port to read any of the stored strings from any port.

!STH stores the hours into the SP interface real time clock.   The 
hours are indicated by an appended two-digit number.

!STM  stores  the minutes into the SP interface real  time  clock.  
The minutes are indicated by an appended two-digit number.

!STP  returns the port number.   Append A or B to  indicate  which 
string is to receive this character.   This will convert the  port 
number  so  that  ports 10 through 12 will  be  indicated  by  the 
letters A, B and C.

!STS  sets  the  seconds  in the SP  interface  real  time  clock.  
Indicate  the  number of seconds to set by appending  a  two-digit 
number.

!STT  stores  the contents of the A string to  any  port's  stored 
string zero.  Append the number of the port.

!SW - Swap or Set with.  With nothing appended this command simply 
swaps  the contents of the A and B strings.   Other forms of  this 
command are:

!SWC places the caller's password access code into the A string.

!SWD  places the time and date as an encoded 8-digit  number  into 
the A string.  The format is MMDDYYHHMMSS.

!SWN places the caller's logon name into the A string.

!SWT places the time/date line into the A string.

!SX - Set execute description.   Append a description and whenever 
an  interpreter  command is being executed that  description  will 
show in the result of the I2 command or the /W executed in  either 
chat room.  !SX with nothing appended turns this function off.

!SY - System variable access.   There are many system variables at 
work  which control or track the functions of the  BBS.   Some  of 
them  are general variables that control the entire operation  and 
others  are specific to the various ports.   This  command  allows 
reading  and writing these variables.   Append R to read or  W  to 
write,  plus a letter to indicate which variable to read or write.  
Some  of  the  variables  will  require  additional   information.  
Information read or written is normally returned to or taken  from 
teh A string unless otherwise noted.  The variables accessible are 
listed by the letters used:

A - background port number.   This variable may not be changed, so 
this is read only.

B - Highest message number on line.  

C - Lowest message number on line.

D - Maximum number of ports on the interface.

E - Caller number,  which is the counter that is saved to the STAT 
file each time a caller logs on.   Since STAT is never read except 
when  the  BBS is initializing,  this command is the only  way  to 
change your caller number without taking the BBS down.

F  - Message base names.   Append a space or upper case letter  to 
indicate the message base designator.

G - Non-password access code.

H  -  Main (default) directory.   This is normall read  in  during 
initialization of the BBS.   Be careful if you do change it.   The 
new  directory must contain all of the required system  files  and 
menus.

I - Highest message index entry.  The pointers to the message base 
are kept in an array.   This is the number of the highest  element 
used  in that array and indicates the number of messages  (public, 
private and deleted) currently on line.

J  - Index entry.   This is the array of  message  numbers.   Each 
entry  contains  the  message  number  plus  the  codes   required 
(public/private/delete  flag,  message  base  designator  and  the 
letter  of  the file containing the message).   Append  the  entry 
number of the element to access.

K - Locator array.   Each index has an entry in both the index and 
this  locator array.   The locator is the offset into the  message 
base  file  of the beginning of the  message.   Append  the  entry 
number of the element to access.

L - Chat capture routing.   This will contain zero if remote  chat 
capture is off (to capture to the port 0 screen use the I7 command 
and route chat capture to CON:  instead of a disk file).   If  the 
contents  are  non-zero,  chat  capture is  being  routed  to  the 
indicated port.

M  -  Forbidden words array.   Append a digit  to  indicate  which 
element is to be accessed within this array.

N - Number of entries in the download list.  Append a port number.

O  - Download list entries.   Append a port number and a digit  to 
indicate which port and which of the ten entries to access.

P - Terminal port.  This will contain the number of the port being 
used  to  call out.   If no port is being used this  command  will 
return a slash (/) character.

Q  - Telegram mask flag.   Append the port  number.   0  indicates 
telegrams are off and 1 indicates that they are on.

R - Linked chat forewarding array.   Append a number between 0 and 
49.  This is where lines are kept, for sending to the host system, 
when the BBS is linked to a host system.

S  - Linked chat room array.   Append a number between 0  and  49.  
This is where lines are received from callers when the BBS is  the 
host in a link or when it is not linked and where lines are  taken 
to send to callers who are in linked chat.

T  -  Local chat room array.   Append a number between 1  and  20.  
This  is the array where the lines entered in the local chat  room 
are kept.

U - Head pointer for the linked chat forewarding array.

V - Head pointer for the linked chat room array.

W - Head pointer for the local chat room array.

X - Append a port number.  This is the tail pointer for the linked 
chat room array for the indicated port.

Y - Append a port number.   This is the tail pointer for the local 
chat room array for the indicated port.

Z - This is a 1 if character masking is on or 0 if it is off.

!TG - Telegram on/off.  Append ON or OFF to turn telegrams to your 
port on or off.

!TI - Change time limit.  Append +, - or = followed by a two-digit 
number.   This  will  alter the number of minutes allowed  on  the 
current call.

!TR - Trace.   Append ON or OFF.   This must be executed within  a 
command file.   Trace is automatically turned off when the  caller 
returns  to a menu or logs off (whether by  J3,  J3A,  timeout  or 
dropeed  carrier).   When  trace  is on,  after  each  command  is 
executed,  the prompt "tr?" appears and the system will wait for a 
one-character input.  Entries include:

A or B shows the contents of the indicated working string.

C  shows  true or false according to the setting  of  the  compare 
flag.

a digit (0-9) shows the contents of the indicated stored string.

x or X exits trace mode and returns to the menu.

RETURN proceeds to execute the next command.

Note that all the above functions except x (or X) and RETURN  will 
return to the "tr?" prompt for the next command without  executing 
another command until a RETURN character is received.

!UH - Unhog.  Turns hog mode off.  See also !HG.

!UP  - Upper.   Append A or B.   All lower case characters in  the 
indicated string are converted to upper case.

!WF  -  Wait  for key.   Append A or B followed  by  a  string  of 
characters.   This  command will stop execution at the port  until 
one  of the characters in the appended string is  received.   When 
received, the character is stored in the indicated string.

!WK - Wait key.   Append A or B.  This command will stop execution 
at  the port until any character is received.   The  character  is 
stored in the indicated string.

!X - Binary calculation mode.   Append A or B,  an operator and an 
operand.   A one-step operation is computed from this  information 
using  the  first byte of the indicated A or B string as  the  "x" 
component  in the desriptions that follow and the operand  as  the 
"y"  component.   The  operators that yield a  result  place  that 
result  in  the  A or B string as indicated for  use  as  the  "x" 
component.   All  computations are done in binary and the  results 
are mod 256,  so all results are positive one-byte indicators.  If 
the result of a computation is zero, the compare flag is set false 
and if the result is not zero the compare flag is set true.

The operators used are:

% computes the percentage as x=100*x/y

= sets x=y

+ computes x+y (addition)

- computes x-y (subtraction)

* computes x*y (multiplication)

/ computes x/y (division)

< sets compare flag according to x<y

> sets compare flag according to x>y

# sets compare flag according to x=y

A logical result of x AND y

O logical result of x OR y

I inverts x (actually performs 255-x)

The operands may be:

A or B to use the first byte of a working string for "y"

S0 to S9 to use an element of the string array

a numeric between 0 and 255 to use a constant

!X  commands may also be stacked to provide multiple  computations 
as one statement.   To stack them,  simply append them together in 
the  order they are to be executed.   They will be  executed  from 
left to right.

!Y  -  Integer computations.   This command is similar to  the  !X 
command, requiring A or B, an operator and an operand.  Instead of 
operating  using  one-byte values,  the !Y command  uses  positive 
integers in ASCII format numbers up to six digits in length.   !YA 
and  !YB  use the same operands as !X but not  all  operators  are 
allowed.   !Y uses %, =, +, -, *, /, <, > and # but not the binary 
A,  O and I operators.  For descriptions of the operators and list 
of operands, see the description for the !X command.

RANDOM ACCESS FILE COMMANDS

!ZC - Close random access file.  Note - do not close a file unless 
there is actually a file open or some rather unpredictable  things 
can happen to your port 0.

!ZG - Get.   Append A or B.   The next 80-character record is read 
from  the  currently opened file and is stored  in  the  indicated 
string.  When the record has been read, the file pointer is set to 
the beginning of the next sequential record in the file.

!ZN  -  Open  new  random  access  file.    Append  a  full   file 
specification.   Random  access  files  are  opened  assuming  the 
records  are  80  character long.   !ZN will create  a  new  file, 
deleting  any  file  that  may have existed  with  the  same  file 
specification.   Note  that the file pointer is not set  when  you 
open  a new file so you must use !ZS to point it to record  number 
zero before writing to the file.

!ZO - Open random access file.   Append a full file specification.  
The file must be a random access file organized with  80-character 
records such as files set up using the !ZN command.  Note that the 
file pointer is not set when the file is opened so you must use  a 
!ZS command to point to a record before reading or writing.

!ZP - Put.   Append A or B.  The indicated string (or the first 80 
characters  of  the indicated string if the actual length  of  the 
string  is  greater) is written to the random access file  at  the 
current pointer position.  After writing the record the pointer is 
set at the beginning of the next sequential record in the file.

!ZS - Seek.   Append A or B.  The indicated string must contain an 
ASCII  format  integer.   The file pointer is set  to  the  record 
corresponding to the number.   Note that record numbers begin with 
record  zero and that there is no way to check for end of file  so 
you must keep track of the number of records in the random  access 
files you are maintaining.



