Getting a Pointer to the String in a Memory File Row

You can access the string pointer for any memory file row with the function mf_rowp():

UCHAR *mf_rowp(mf_row, mfp)
 
int mf_row;
/* Row to find get string pointer
*/
MFILEPTR mfp;
/* Memory file to access
*/

which returns a pointer to the specified row in the memory file. Thus, to write the contents of file row number 5 (the sixth row) to a window, you could use the following code fragment:

UCHAR *stp;

stp = mf_rowp(5, mfp);

v_st(stp, &wn); 

Caution: You can also use the pointer returned by this function to directly modify a string located in the memory file as long as you do not change the length of the string. If the length of the string may change during editing of the string, copy the contents of the string to a string buffer, make your modifications, and replace the string in the memory file with mf_rowrpl().


Home Contents Previous Next