INMEMO

Updated February 2013; see History

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

INMEMO.SBR 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

Value

Description

 

Symbol

Value

Description

MMO_DSP

&h00000000

Display

 

MMO_UWE

&h00010000

Update without edit

MMO_EDT

&h00000001

Edit

 

MMO_SVA

&h00020000

Save screen area

MMO_BDR

&h00000002

Border

 

MMO_RSA

&h00040000

Restore screen area on exit

MMO_LID

&h00000004

Smart line insert and delete

 

MMO_CXY

&h00080000

Start at position EXTROW,EXTCOL

MMO_DEL

&h00000008

Delete

 

MMO_NOA

&h00100000

Do not display navigation arrows

MMO_LIN

&h00000010

Return one line of memo text

 

MMO_AAH

&h00200000

Auto adjust (shrink) height to fit data

MMO_OPN

&h00000020

Open memo file

 

MMO_IPG

&h00400000

Intelligent paging mode

MMO_CLS

&h00000040

Close memo file

 

MMO_DBM

&h00800000

Start display at bottom

MMO_NBR

&h00000080

Do not redraw border

 

MMO_ISL

&h01000000

Insert into sorted list

MMO_NMR

&h00000100

Do not redraw border or text

 

MMO_APS

&h02000000

Alternate prompt style

MMO_SCH

&h00000200

Search

 

MMO_NAF

&h04000000

No auto formatting (wrapping)

MMO_SIL

&h00000400

Silent operations (no display)

 

MMO_OTX

&h08000000

Output memo to TEXT

MMO_DPG

&h00000800

Display with paging control

 

MMO_FFM

&h10000000

Free form menu or dialog box mode

MMO_MNU

&h00001000

Menu mode

 

MMO_OPT

&h20000000

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

MMO_TBL

&h00002000

Table lookup

 

MMO_RAW

&h40000000

Save/retrieve raw text

MMO_FST

&h00004000

Fast menu mode

 

MMO_HDR

&h80000000

Output invisible headers with chr$(26) delimiters

MMO_EWU

&h00008000

Edit without update

 

MMO_RET

&h80000000

Return key exits memo

Definition file: ashinc: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.