Determining the Size of a Memory File

You can determine the number of filled rows. This will assist you in making sure that you are not adding a line beyond the end of the memory file. To determine how many filled rows there are in the memory file, call the memory file row quantity function, mf_rowq():

int mf_rowq(mfp)

MFILEPTR mfp;        /* Memory file to check                */

mf_rowq() returns the number of filled rows in the memory file. To determine the number of the last filled row in the memory file, call:

int last_row;

last_row = mf_rowq(mfp) - 1;

To determine the length of the longest line in the memory file, call the memory file column quantity function, mf_colq():

int mf_colq(mfp)

MFILEPTR mfp;        /* Memory file to check                */

mf_colq() returns the number of characters in the longest line of the memory file.


Home Contents Previous Next