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:
- Call cnc_end() before asking for confirmation on something dangerous, like deleting important information.
- Call cnc_end() after errors, to stop the rest of the user's command from being executed.
- Use cnc_more() to see if more input is available, or rely on what the other functions return.
- Try to use the get_ high-level input functions wherever possible. They deal with concatenation in the canonical way.
- For that matter, to learn more about how to work with concatenation, refer to the code of those functions.
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.