home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
new
/
comm
/
bbs
/
4d-bbsdemo
/
docs
/
text
/
08.menu_commands
< prev
next >
Wrap
Text File
|
1993-12-28
|
28KB
|
805 lines
Chapter 8: Menus and Menu Commands
8.1 Overview
The menus are the heart of the BBS. They direct the user around the
BBS and act as a guide. Whether the menus are simple and plain, or
complicated and fancy, the SysOp has complete control over every aspect of
the menus. This is a powerful feature enabling the SysOp to personalize
and create a BBS which is very unique.
8.2.1 Menu Formats
All menu files are plain ASCII files located in the MENU: directory.
Editing and creating menus should be done with a text editor of your
choice.
The first line of the menu file should be the help file for the menu.
This filename is appended either as .ASCII or .ANSI automatically by the
BBS, depending on the on-line user's mode.
The second line is the prompt for the menu. This can include EIC
codes and color codes. If color codes are encountered and the user is in
ASCII mode, they will simply be ignored. There is a maximum of 80
characters.
The third line is the type of entry for the menu as listed below.
TYPE DESCRIPTION
0 Hotkey: User enters one character without entering return.
#>0 User can enter UP TO # characters, and must press Return at end
(i.e. 10 means the user can enter up to 10 characters.)
# The number sign means that a user can enter one character without
having to press Return or enter up to a 3 digit number and must press
return. This is most often used in a menu to allow the user to enter
hotkeys, and full numbers (i.e. in a message base menu to change sections.
-1 No user entry for this menu, and the first command will be executed
automatically, irrelevant of the keypress code. If the following commands
also have the same keypress, they will be executed also. This mode is
designed for Command Menus.(Refer to section 8.4.1)
From the fourth line on, each line represents one function.
Everything on the line before the ":" represents the keypress for that
function, everything on the right side of the colon is assumed to be the
command. The command can be split up into 1 to 4 parts separated by
spaces.
If a keystroke has more characters than allotted in line three, the
function WILL NOT be accessible by the user. Multiple lines CAN HAVE the
same keystroke, in which case all lines will be executed BUT they must ALL
be consecutive lines in the menu file.
An example line would be:
p:p p 0
This means the keystroke is a single "p", and the command is ":p" with
parameters of "p 0". An example of multiple lines would be:
o:2 TEXT:LOGOFF.TXT
o:0 q
This would display the file "TEXT:LOGOFF.TXT" to the user, then do a
quick logoff. The following would NOT execute the third line:
o:2 TEXT:LOGOFF.TXT
o:2 TEXT:LEAVE.TXT
p:p p 0
o:0 q
In this example, the BBS would execute the first two commands, but
upon seeing that "p" (line 4) is different from the "o" (line 2) the BBS
would return to the prompt, and NOT execute the fourth line.
8.2.1 Layouts
4D-BBS uses menu locks to control user access to menus. These menu
locks can be unique to each user, and are system specific. When designing
your menus, it is best to first list all menus which you will be using, and
give a unique lock to each menu. If some menus are similar in function,
you can give the same lock to them to cut down on the number of menu locks
used. (Refer to section 8.5.1 for more information.)
There are two types of menu layouts which can be used. The first is a
hierachy method which means a menu is called, and when finished, the
calling menu regains control. You can stack menus in this method up to 16
times, so keep this in mind when designing your menus.
The second method is a basic goto or jump. In this method, the
calling menu is NOT remembered. This is ideal if you wish to setup a maze
or theme type, BBS since menus do not have to be remembered.
Below are two examples of menus:
Main Menu
_____________|___________________
| | |
Message Bases File Transfers Game Room
|
Electronic Mail
In the above setting, a user starts out at the Main Menu, and can go
to one of the 3 menus. If they choose the Message Bases, they can not go
into the Game Room unless they exit the Message Bases and go back to the
Main Menu. If they are in the File Transfers, and want to go to Electronic
Mail, they must go to the Main Menu, then the Message Bases, then finally
to Electronic Mail.
+- Main Menu -+
/ | \
Message Bases +---------+------------+- Game Room
| \ | /
E-Mail +- File Transfers -+
In the above example, a user can jump from any section they wish to,
EXCEPT for the E-Mail section. To go to or from the E-Mail section, they
must go through the Message Bases.
Remember the above are ONLY examples, and the SysOp can setup the BBS
using one of them, a combination, or design their own layout.
8.2.2 Menu Move Commands
The "0" and "1" menu command cover most basic menu move operations.
They are as follows:
COMMAND DESCRIPTION
0 e Exits the current menu, and returns to the calling menu. Can only
be used if the calling menu used the "1" command.
0 M Returns to the main menu and clears all hierarchy stacks.
0 * NAME Enters a new menu WITHOUT saving the previous menu. The "*"
is the lock for the new menu. The new menu does NOT know who the calling
menu was.
1 * Name Enter a name menu saving the previous menu. The "*" is the
lock for the new menu. The new menu DOES know who the calling menu is and
can use the "0 e" command to return to the calling menu.
The two basic commands for moving between menus can be mixed, as in
the second example of section 8.2.1, but caution should be exercised when
doing so. A loop like this can cause stack limit problems:
Menu --+
| |
Sub-Menu |
| |
Sub-Menu2 -+
If a jump was used to go from Sub-Menu2 back to Menu, the stack would
not be cleared. Doing this too many times would bring upon a maximum
sub-menus encountered error to the user.
8.3 Menu Commands
When a user presses a menu key the BBS will scan the menu file to see
if any matching keypresses are found. If none are found and the menu is in
Hotkey mode, nothing will happen and the BBS will accept another character.
If the menu is multi-character input and the BBS does not find a match, it
will display "Unknown menu function" and redisplay the prompt.
If the BBS does find a match, it will execute the command after the
":" in the line, and then check if the next line is the same. If it is,
then that line will also be executed and this cycle is continued until
either a match is not found or the last command is executed.
Once a command is finished the BBS displays the prompt again and
starts this process over again. If the command which was executed goes to
another menu, this process is continued on THAT menu. If the command logs
the user off, the process stops.
8.4 Types of Menus
Currently there are 4 types of menus which you can setup. These are:
Command, Personal, Access, Global and Default Menus.
8.4.1 Command Menus
A Command Menu is a menu that directly executes the first command
without displaying the logon/stats screen or bulletins. An example of
using this type of menu would be if you wanted to spawn a serial based
program when a certain account logged on. UUCP's UUCICO could be used this
way.
The format for this type of menu is the "Cmd." plus the account name
plus ".menu". So, if you were running UUCP, and your feeds logon account
was called UUCP, you would make a menu called "Cmd.UUCP.Menu", which is a
normal menu with the first command as "a:4 UUCICO" and the second command
as "a:q". Although the keypress for the commands are irrelevant, they MUST
be the same.
8.4.2 Personal Menus
A Personal Menu is the same as a main menu, except it is used INSTEAD
of the Default, Access or Main Menu. This allows you to give a different