The example program showed how to prepare the menu with an editor and read it into a memory file with mf_rd(). Alternatively, you can code the choice list menu items and place them in a memory file with mf_rowrpl(). This will save you from having to provide a separate text file with your code.
Here is a fragment for preparing a simple menu in code using mf_rowrpl().
|
The memory file is first defined and initialized by the call to mf_def(). The memory file will have eight rows of thirty characters each. The keyword is first placed in the memory file with a call to mf_rowrpl(). Subsequent calls to mf_rowrpl() place the specified strings in the rows of the memory file.
As an alternative to using multiple calls to mf_rowrpl(), you can repeatedly call cli_ins() for a memory file that only has one list and no keywords.
For more information on building memory files in code instead of using mf_rd(), see Chapter 45, "Creating and Viewing Memory Files."