Command concatenation

Processing multiple commands typed together.
I don't know if this was supported anywhere else before the Major BBS, but that's where I first saw it. The concept is nice: expert users can concatenate multiple commands, instead of typing them one by one and getting menu after menu sent to them. This makes a lot of sense for both advanced users and those on a slow line.

This group of functions helps handle such commands. Commands processing must use these function as much as possible. There are many guidelines on how to use them, but most are empirical. A few I can remember right now are:

The cnc_ functions will provide you with information from the user's input in an incremental way. You should only ask for what you need. If you only need a single menu option, don't call cnc_word(). Doing so will gobble any other commands the user has stuck after the one you need.

Before calling one of the main cnc_ functions, make sure there is input for you. The cnc_more() function should be handy. If there's no more input, you should call inp_get() to obtain some. Yes, this is tedious stuff. That's why it's recommended you use the get_ functions.


o cnc_nxtcmd
Next character in command concatenation
o cnc_begin
Begin concatenation handling.
o cnc_end
End concatenation processing.
o cnc_chr
Read a concatenated character.
o cnc_int
Read a concatenated 32-bit integer.
o cnc_long
Read a concatenated 64-bit integer.
o cnc_yesno
Read a concatenated `Y' or `N'.
o cnc_word
Read a space-delimited word.
o cnc_all
Return all remaining concatenated commands.
o cnc_more
Check remaining input.
o cnc_hex
Read a concatenated hexadecimal 64-bit integer.
o cnc_num
Read an arbitrary precision integer.

Alphabetic index



This page was generated with the help of DOC++.