Custom Extensions

You can add your own extensions to APEX, which are accessed as buttons on the toolbar and which call your own BASIC code, by defining them in the APEX configuration file, ASHCFG:APEX.CFG. The configuration file, if present, is scanned for commands of the following form:

BUTTON=prog, iconspec, tooltip {,msgno, inifile}

prog

indicates the subroutine which implements the extension. In theory it wouldn't have to be an SBX, but currently that is the only format supported, so prog must be in the form of "SBX:name", e.g. "SBX:PRTXLS". The corresponding subroutine (e.g. PRTXLS.SBX) must be in the BAS: directory (e.g. c:\ate\dsk0\007006\prtxls.sbx). The subroutine should be written according to the same interface specifications used by the printer initialization command line, COMMAND=SBX:... (see A-Shell Setup Guide).

iconspec

specifies the icon to display in the button that will be added to the toolbar. Supports the same syntax as for AUI_CONTROL icon buttons (see the A-Shell XCALL Reference).

tooltip

is a short tooltip to display when the mouse hovers over the button.

msgno (optional)

may specify a message number in the file <inifile.lng>, where lng is the current language extension, e.g. USA, to supply the tooltip text. If present, it overrides the tooltip parameter above.

inifile (optional)

may specify an initialization file used by the extension, although the details of how is is used are up to the custom code in prog.

The file may also contain any number of comment lines, each beginning with a semicolon in the first position. Here's , for example:

;APEX customization

;BUTTON=prog,icon,tip{,msgno,ini}

;If msgno>0, is expected to be msg 002,### in inifile.lng

BUTTON=SBX:PRTXLS,ashico1::document_out,Export to Excel,38,BAS:PRTXLS.INI

BUTTON=SBX:PXLCFG,ashico1::preferences,Configuration Options For Export,0,BAS:PRTXLS.INI

There are no particular limitations on what the subroutine (prog) may do, other than that it cannot delete or replace the file being previewed, and must eventually return so that APEX can resume control.