Please enable JavaScript to view this site.

A-Shell Reference

Navigation: Command Files

Global DO File Parameters

Scroll Prev Top Next More

Reviewed and reorganized June 2020

This is another A-Shell extension that functions something like the special $ information variables, except that their values may be set from within an ASB program. Once set, they retain their value for the duration of that session (unless specifically over-written by an ASB program). There are ten possible global DO file parameters, and they may be invoked on a command line using %0 through %9. The DO file processor substitutes these formal parameters for their values before passing them on to the DO file. For example, consider the command line:

XYZ ONE %3 TWO %0

Assuming that global parameter %3 had previously been set to "gee whiz" and global parameter %0 had previously be set to "humdinger", then this command would be processed as if it were:

XYZ ONE <gee whiz> TWO humdinger

"ONE" would be substituted for $0, "gee whiz" for $1, "TWO" for $2, and "humdinger" for $3.

There is no particular limit on the size of these variables, although there is limit of 200 characters on the length of any expanded command line.

To set global parameters, use XCALL MIAMEX as follows:

xcall MIAMEX, MX_SETGDO, status, g0, g1, g2, g3, g4, g5, g6, g7, g8, g9

The values of the variables g0 through g9 (all of them optional, all of them string or unformatted) will be plugged into the corresponding global parameters. Any of the parameters g0 through g9 that are not specified will cause the corresponding variable to be cleared. Status (F,6) will be returned as 0 for success, else error.

See the sample program MIAMEX.BP in EXLIB:[908,30] for an example of setting and even retrieving these global DO parameters. Although they were designed to be used with DO files, there is nothing stopping you from using them for holding and passing parameters amongst your own programs.