A memory file stores text strings sequentially in file rows. Each file row is numbered. Numbering starts at 0. Figure 45.1 shows how this is done. A memory file is managed by a memory file structure, MFILE. This structure contains information such as the maximum rows in the file, the maximum characters (columns) in a file row, and a pointer to an array. The array, which is the size of the maximum number of rows in the memory file plus 1, contains pointers to a memory file line structure, MFLINE. The memory file line structure holds the pointer to the string for that particular row in the memory file.
Note that there is a difference between a blank memory file row and an empty memory file row. A blank memory file row has an associated string. This string may contain (1) no characters at all (just the null terminator) or (2) only blank characters (spaces and tabs). An empty line in a memory file does not even have an associated string and does not use memory.

Figure 45.1: Diagram of Memory File Structure