TEXT:  General purpose text exchange parameter

TEXT is a string whose use depends on OPCODE. For all of the display and edit calls, TEXT should contain the memo area prompt. If not specified, there will be no prompt (or title). (In the picture in section 2.0, the memo prompt is "Comments"). You may also specify a bottom prompt or message by appending a chr$(13) followed by the bottom prompt text. If you include the chr$(13) but nothing after it, you will have no bottom prompt, even in menus and other situations which normally contain an automatic bottom prompt. For example:

TEXT = "Top Title" + chr$(13) + "Bottom Title"

TEXT will be displayed in reverse video (see MMO'APS:  Alternate Prompt Style for exceptions), left justified along the top of the memo. If you want to center the TEXT string, add sufficient leading spaces to move it over the desired amount; the spaces will not display in reverse video but they will shift the text string over to allow centering.

The other uses of TEXT are discussed below along with the corresponding memo operation:

Return 1 Logical Line: For this operation, the line is returned in TEXT. Note that you must check POS (XPOS) to determine if the returned TEXT is valid.

Application Controlled Memo Editing: For edit operations on file-based memos, INMEMO will process characters from the TEXT parameter prior to turning the keyboard over to the operator, allowing you to pre-load initial memo values, time and date stamp, insert a blank line at the top of the memo, etc. This is accomplished by appending a tilde (~) to the prompt (if any), followed by any string of characters to be interpreted exactly as if they had been typed, and calling INMEMO in an editing mode.

A few pointers on application-controlled memo editing are in order here. First, you can mix editing and text characters together, and you may want to terminate the string with an ESCAPE character (chr$(27)) or else the user will be left in editing mode after all of the TEXT characters have been processed. You can rely on INMEMO to word-wrap the lines for you, although this gets visually messy if the absolute line length is longer than the window (see VSPEC:  Set maximum physical width and height below.) If adding a lot of text at once, you might want to turn off the display by adding MMO'SIL to the OPCODE parameter. If you put your own line breaks in, use only a carriage return (chr$(13)) and no line feed between lines. If you want to time and date stamp each new entry in a memo pad, use a control-E (chr$(5)) followed by a carriage return to move the cursor to the end of the memo and start a new line. Follow with the time and date string and then end the TEXT string there; the user will be left in editing mode next to the time and date which you entered automatically. (You can set up reverse chronological order in a memo consisting of one-line entries by inserting a line with control-B at the start of the memo for each edit operation.)

Note that if you don't want the time-stamped entry to be saved unless the operator actually adds something to it, then end the TEXT string with a tilde. This resets the internal status flag which keeps track of whether the memo has been modified which in turn determines whether it needs to be re-written to disk on exit.

If using the application-controlled editing feature for some sort of demonstration purpose, you might want to slow the processing of the text. This can be accomplished by inserting additional tilde characters in the text to be loaded. Each tilde (after the initial one) will cause a 1/10 second delay. Try the TSTMMO program supplied with INMEMO for an example of this - you can examine its source code for more details.

No-File Mode: In no-file mode (specified by setting the CHANNEL parameter to zero), all memo text is read from and written to the TEXT parameter (instead of the disk file). The format for TEXT is the same as for application controlled memo editing, except that the characters are treated as if they were loaded from a file instead of entered from the keyboard, and thus they do not update the cursor position and editing commands are not recognized. If you want to preload some text and then follow with some editing commands (for example, to position the cursor at the end of the last line with a control-E followed by control-N), then append a chr$(3) to the end of TEXT, followed by your editing commands. For example,

TEXT$ = TITLE$ + "~" + MEMO$ + chr$(3) + chr$(5) + chr$(14)

 

See the discussion on CHANNEL:  Memo file channel or specification below for more information.

Specifying Defaults for Selection Menus: For opcode MMO'MNU (menu mode), you can use TEXT to specify the starting position of the selection bar. This can be quite important for selection menus within a maintenance screen to prevent the selection from accidentally being changed back to the first option during editing. For example, in a menu of 10 choices, if you selected the third choice by moving the selection bar down and hitting Enter, you would expect the selection bar to start on that same choice if you re-enter this selection menu. To accomplish this, append a chr$(3) to the end of the TEXT parameter, followed by enough characters of the item description to make a unique match. For example, consider this selection menu:

1. UPS Red

2. UPS Blue

3. UPS Ground

4. US Mail

 

To specify the 3rd option (UPS Ground) as the default (initial) position of the selection bar, you need to specify at least "UPS G" to make a unique selection:

TEXT$ = TITLE$ + "~" + MENU$ + chr$(3) + "UPS G"

Note that this example assumes you were in no-file mode, where MENU$ was a string containing the list of menu options. The tilde (~) is always needed to terminate the prompt (or title) unless that is the only thing contained in TEXT. The chr$(3) is always needed to flag the end of the no-file memo text and the beginning of the default selection specification. Here are some examples of other valid strings for TEXT with menu defaults:

TEXT$ = TITLE$ + "~" + chr$(3) + DEFLT$

TEXT$ = "~" + chr$(3) + DEFLT$

 

The first example illustrates a file-based menu; note that both the tilde and the chr$(3) character are needed - one to terminate the TITLE$ and the other to terminate the null pre-load string. The second example shows the same situation without a title. Again, note the need to specify both the tilde and the chr$(3).

If the default menu item is not found, the menu bar will start at the top.

Specifying Invisible Menu Headers: You may pass an invisible header string to INMEMO when editing or adding a new memo. This string is stored at the beginning of the memo and does not display, but it can be retrieved using MMO'LIN, edited with ^S^H (see Operator usage) and dumped with DMPMMO.BAS. To specify an invisible header, enclose it in the preload area of TEXT as follows:

TEXT = "Title" + "~" + MMO'INVHDR + "Invisible Header" +chr$(19) + "other preload text"

MMO'INVHDR is defined in MMOSYM.BSI and actually equals chr$(19) + chr$(8).

Edit without Update and Update without Edit: For these opcodes (MMO'EWU and MMO'UWE), the TEXT parameter is used to temporarily store the updated memo (after the MMO'EWU operation) until it is written to disk (with the MMO'UWE operation.) Note that you can still pass a title and preloaded text into the MMO'EWU operation, but that it will be replaced by the updated memo text. Naturally the size of TEXT must be large enough to accommodate the memo.

Opening the Memo File: When using the MMO'OPN opcode to open the memo file, TEXT must contain the file specification of the memo file.

Output memo to print file: (A-Shell only.) As a convenience, you may output an entire memo directly to an open print file by replacing the TEXT parameter with a numeric variable (of type B or F) containing the channel number of a file open for sequential output. In order to prevent the output from going beyond the end of the page, you may limit the number of lines output by setting the maximum in EXTLIN. (If EXTLIN is 0, there is no maximum.) If the operation is interrupted by the maximum, the next call will continue where it left off, allowing you to use your own page header logic. Also, to position the memo lines on the page in the proper column position for your report, you may specify a margin in EXTMGN. (See EXTCTL:  Extended options for mapping of EXTLIN and EXTMGN.)

Embedding Tilde: To embed a literal tilde in the title or text, use the HTML-encoding syntax %7e, e.g.

TEXT = "This title has a tilde (%7e) in it"