All memory file functions that display or operate on the memory file will, by default, operate on the whole memory file. You can work with one section of the memory file by (1) marking the section of the memory file with a keyword and (2) setting the system to only use the section headed by a specific keyword.
Once the system is set to use a keyword section, all memory file viewing and editing functions work within the section instead of the entire memory file.
If a keyword section is in use, memory file functions expect the row number of the memory file row to be relative to the beginning of the keyworded section. When a memory file is set to work on one keyworded section, for example, mf_rowq() returns the number of filled rows in this keyworded section, instead of the number of filled rows in the memory file.
Follow the steps below for setting the system to work on only one section of a memory file.
Step 1: Mark the memory file with keywords.
A line containing a keyword is used to mark each section of the memory file. A keyword must:
The keyword can be more that one word in length. Only those lines containing keywords can have the keyword character in the first column.
You can either (1) edit your ASCII disk file to include lines for each keyword or (2) insert keyword lines in an existing memory file.
Below is an example of lines in an ASCII text file that has two sections marked by keywords.
|
Caution: The keyword character that marks the keyword must be in the first column of the line.
Step 2: Set the system to use one section with mf_kwdset().
To set the system to use a section of the memory file, use the memory file keyword set function, mf_kwdset():
|
||
|
|
|
|
|
|
If you specify NULLP for the keyword, then the whole memory file is used.
Once the system is set to use the specified keyword section for this memory, all functions operating on this memory file will operate only on the section with the specified keyword.
When operating only on a keyword section of the memory file, functions accept the row number relative to the keyword (not the entire memory file).
When displaying a memory file set to use a keyword section, only the section of the file marked by the keyword is displayed in the window. The keyword itself will not be displayed.