The Edit Memo Pad call is used to either add a new memo pad or to modify an existing one. The parameters are as follows:
opcode should be MMO'EDT (edit vs. display) plus the values of the border and smart insert/delete options desired. For example, if you want to draw a border around the window and use smart insert and delete, set opcode to ÀMMO'EDT+MMO'BDR+MMO'LID. If you don't want the border but do want the smart insert/delete, set opcode to MMO'EDT+MMO'LID. Note that INMEMO will still check in the terminal driver to make sure smart insert/delete functions are available before using them.
text, channel, strow, stcol, endrow and endcol are set the same as in the display memo pad call (see above).
link depends on whether you want to start a brand new memo pad or modify an old one. If you are adding a new one, then LINK should be set to zero. On return, INMEMO will set link to point to the first physical memo record in the memo pad.
If you are modifying an existing memo pad, LINK must contain the starting physical memo record number of the existing memo pad. This will allow INMEMO to display the memo pad before editing, and also to allow it to delete the old memo pad before adding the new one to the file. Again, on return, INMEMO will set LINK to point to the first physical memo record in the memo pad. This should then be stored in the primary file record to which the memo pad is attached. Note that when editing an existing memo pad, the LINK variable will not change, unless you delete all of the text in the memo pad, in which case the LINK will come back as zero. (Removing all of the text from a memo is functionally equivalent to deleting it with OPCODE = MMO'DEL.) Since you can't control whether the operator deletes all of the text, you must either always rewrite the updated LINK back to the primary data record or at least check if changed, and then write it back. Failure to do this will result in memo link errors.
vspec should be set to control the limits of horizontal and vertical scrolling of the memo window.
pos will be set to zero if no error occurred, otherwise it will contain the error code.
exterr will be set to zero if no error occurred; it will be set to MME'SAF if you requested to save and/or restore the screen area and this could not be done, and it will be set to MME'ERR if any other error occurred.
extcod will be set to 0 if the memo was exited normally (with Escape), MMX'QUI if the user aborted with ^C, or it will equal the negative of the function key number used to exit the field. Note that you have to convert the unsigned binary extcod to a signed format in order to check for negative numbers.