Please enable JavaScript to view this site.

A-Shell Reference

Navigation: Subroutines > MIAMEX

MX_GETERSATZ

Scroll Prev Top Next More

Reviewed and revised April 2024

xcall MIAMEX, MX_GETERSATZ, ersatz, dev, proj, prog, status

MX_GETERSATZ (MIAMEX 11) is used to obtain information about the defined ERSATZ devices. Each call returns the next defined ERSATZ device in sequence.

Parameters

ersatz  (String, 10+)  [in/out]

Returns the next defined ERSATZ device name without the trailing colon. To start from the beginning, set ersatz to "". Any other value is ignored on input, as it uses a static internal cursor to maintain its position in the table of definitions.

dev  (String, 6+)  [out]

Returns the real device corresponding to the ersatz device, e.g. "DSK0"

proj, prog  (Num)  [out]

Return the two parts of the PPN corresponding to the ersatz device.

Warning: if B1 variables are used here, the routine will translate the PPN parts into octal, which is almost certainly not what you want except in certain legacy situations. Any other type will return the normal decimal PPN values, each of which ranges from 0 to 999. See PPN Numbering for the complete back story.

status  (Num)  [out]

Returns zero if not yet past the end of the table, i.e. indicating that the rest of the returned parameters are valid. Returns one indicating that the end of the table has been reached and the other parameters should be ignored. The next call will start over at the beginning of the table. See the ersatz above for how to force it to start over at the beginning.

Comments

Note that a short-cut is available to reset to the first ERSATZ device. If the ersatz parameter is a null string, then information on the first ERSATZ device will be returned; it is not necessary to go around a loop waiting for a returned status of one.

See Also

MX_GETDEV scans the table of real, i.e. non-ersatz devices