INMEMO

Updated February 2013; see History

xcall INMEMO, opcode, text, channel, strow, stcol, endrow, endcol, link, xpos, vspec, mmoclr, extctl

INMEMO was originally developed in the 1980s for use under AMOS. Its purpose is to provide an easy way for programmers to store and manipulate variable-length text structures. Although these structures may include light-bar menus, help screens and lookup tables, the most common and traditional use is to include free form, expandable memo pads within file maintenance programs. A-Shell contains a runtime implementation of INMEMO.SBR (and XFRMMO) which is about 95% compatible with the AMOS version.

Full documentation for INMEMO is provided in a separate document called the INMEMO Reference, which see for detailed information (available on the main A-Shell documentation page). The abbreviated notes provided here are intended for programmers who are familiar with the routine but just need a quick reference to the parameter list.

Note that XTEXT offers similar basic functionality with a GUI interface.

Comments

PCKLST acts as a front-end to INMEMO to create pop-up pick-list boxes.

The A-Shell version of INMEMO is slightly more advanced than the AMOS version in the implementation of free-form menus, in that it supports hidden text associated with an option (following a backslash as with regular vertical menus). For example, assuming the menu item delimiters were brackets, the text "[Mystery Option\secret]" would display as "Mystery Option", but if selected, would return the full "Mystery Option\secret".

 

Parameters

opcode  (Num)

specifies a combination of flags from the following table.

Symbol

Description

 

Symbol

Description

MMO_AAH

Auto adjust (shrink) height to fit data

 

MMO_LIN

Return one line of memo text

MMO_APS

Alternate prompt style

 

MMO_MNU

Menu mode

MMO_BDR

Border

 

MMO_NAF

No auto formatting (wrapping)

MMO_CLS

Close memo file

 

MMO_NBR

Do not redraw border

MMO_CXY

Start at position EXTROW,EXTCOL

 

MMO_NMR

Do not redraw border or text

MMO_DBM

Start display at bottom

 

MMO_NOA

Do not display navigation arrows

MMO_DEL

Delete

 

MMO_OPN

Open memo file

MMO_DPG

Display with paging control

 

MMO_OPT

Disk optimized mode (n/a under A-Shell)

MMO_DSP

Display

 

MMO_OTX

Output memo to TEXT

MMO_EDT

Edit

 

MMO_RET

Return key exits memo

MMO_EWU

Edit without update

 

MMO_RAW

Save/retrieve raw text

MMO_FFM

Free form menu or dialog box mode

 

MMO_RSA

Restore screen area on exit

MMO_FST

Fast menu mode

 

MMO_SCH

Search

MMO_HDR

Output invisible headers with chr$(26) delimiters

 

MMO_SIL

Silent operations (no display)

MMO_IPG

Intelligent paging mode

 

MMO_SVA

Save screen area

MMO_ISL

Insert into sorted list

 

MMO_TBL

Table lookup

MMO_LID

Smart line insert and delete

 

MMO_UWE

Update without edit

Definition file: MMOSYM.DEF

 

text  (String)

has various uses, from titles to preloaded key sequences, retrieved lines, menu selections, and even entire memo or menu contents.

channel  (Num)

is generally the file channel that the memo file is open on. If the CHANNEL parameter is a string, it will be interpreted as the name of the memo file, in which case the memo file will be automatically opened, closed, and even created, if necessary.

strow, stcol, endrow, endcol  (Num)  [in]

specify the dimensions of the memo box, around which the border, if applicable, will be drawn.

link  (B,2 or B,4)

is the link to the memo record.

xpos

is a control variable, which should be mapped as follows

MAP1 XPOS

MAP2 POS,B,4

MAP2 POS2,B,2

 

vspec

controls the maximum scrollable width and height of the memo, and must be mapped as:

MAP1 VSPEC

MAP2 VWIDTH,B,2

MAP2 VROW,B,2

 

mmoclr  (B,1)

if specified, controls the colors for various parts of the memo display, and must be mapped as follows:

Symbol

Description

 

Symbol

Description

BFCLR

border foreground

 

PBCLR

prompt (title) bg

BBCLR

border background

 

WFCLR

warning mssg fg

TFCLR

text foreground

 

WBCLR

warning mssg bg

TBCLR

text background

 

SFCLR

status line fg

AFCLR

arrows foreground

 

SBCLR

status line bg

ABCLR

arrows background

 

RFCLR

ruler/reserved fg

PFCLR

prompt (title) fg

 

 

 

 

extctl

may optionally be specified for extended control parameters, mapped as follows:

MAP1 EXTCTL

 

 

MAP2 EXTCOD,B,2

! exit code

 

MAP2 EXTERR,B,2

! exit error status

 

MAP2 EXTMAP,B,4

! exit code enable bitmap

 

MAP2 EXTROW,B,2

! cursor row

 

MAP2 EXTCOL,B,2

! cursor column

 

MAP2 EXTBYT,B,4

! # bytes in memo

 

MAP2 EXTHIT,B,2

! # rows

 

MAP2 EXTWID,B,2

! longest row length

 

MAP2 EXTPRW,B,2

! # protected rows

 

MAP2 EXTSMI,S,1

! start menu item char

 

MAP2 EXTEMI,S,1

! end menu item char

 

MAP2 EXTMRW,B,2

! error message row

 

MAP2 EXTTOP,B,2

! top window offset

 

MAP2 EXTLFT,B,2

! left window offset

 

MAP2 EXTPCL,B,2

! # protected columns

 

MAP2 EXTTIM,B,2

! max inter-character timeout

 

MAP2 EXTOTH,B,2

! other menu exit keys:

 

 

! 02 = left arrow (EXITCODE -40)

 

 

! 04 = right arrow (EXITCODE -41)

 

 

! 08 = up arrow (EXITCODE -42

 

 

! 16 = down arrow (EXITCODE -43)

 

 

! 32 = tab key (EXITCODE -44)

 

MAP2 EXTJNK,X,14

! for expansion

 

Of the above parameters, perhaps the most important are extcod and exterr, whose values are shown in the tables below. The former is similar to the exitcode parameter in INFLD, receiving a code indicating how the memo was exited. The latter indicates various other error conditions. The variable/symbol names in the first column of the tables below are defined in MMOSYM.BSI.

Symbol

Description

MMX_OK

Normal Updated exit

MMX_QUI

Non-Updated exit (Ctrl+C)

MMX_VTS

Non-Updated exit (VSPEC too small)

MMX_TIM

Updated exit (time out)

MMX_TAB

Tab used to select menu item

MMX_SPC

Spacebar used to select menu item

 

Command function exits are returned as negative numbers F1 = -1, etc.

 

Symbol

Description

MME_ERR

abnormal exit (see POS)

MME_SAF

failure to save or restore area

MME_OK

normal exit

 

History

2013 February, A-Shell 6.1.1335:  Add opcode MMO_RAW to save and retrieve raw text.

2009 October, A-Shell 5.1.1164:  For applications still using INMEMO in an otherwise GUI environment, to make it slightly more Windows-friendly, putting "|K" in your INFDEF string (via SBR=INFDEF:|K, or SET INFDEF, or MIAMEX,MX_INFDEF), will now cause the following changes:

  Ctrl+A selects the entire memo.

  Del (immediately after Ctrl+A) will clear the memo. Any other keyboard operation except Ctrl+C just unselects the memo and then responds as it would otherwise.

  Ctrl+C copies the selected text to the clipboard. This works for both the entire memo selected by Ctrl+A, and also for any other text selected with the mouse.

  Ctrl+V pastes the clipboard text into the memo.

  Escape will prompt whether to save changes, discard or cancel. Since the normal abort key, Ctrl+C, has a different meaning in |K mode, Escape has to serve for both updating and aborting. The text of the messagebox that appears is the same as that used by XTEXT and is defined in SBRMSG.xxx as message 023,001.