MIAMEX 81: Get/set params in SBX

xcall MIAMEX, MX_XCBDATAX, xcbadr, opcode, parmno, var

MX_XCBDATAX This function is needed to pass parameter data between a calling program and an external SBX routine.

Parameters

xcbadr  (Num)

must be set to the address of the parameter structure. This value is passed on the command line to the SBX routine.

opcode  (Num)

must be set to 0 to retrieve a parameter or 1 to pass it back. (For convenience, these values are mapped in the XCALL.BSI file as xcbget and xcbput, respectively.)

parmno  (Num)

is the number of the parameter to receive or send (starting from 1).

var

is the actual variable to receive or send. It should be mapped in a way that is "reasonably compatible" with the actual type and size passed to the subroutine, although conversions and truncations will be applied automatically if necessary.

Refer to the documentation on writing subroutines for more information on this and related MIAMEX functions.

Note also that MX_XCBDATAX has been largely superseded by the A-Shell BASIC extensions XGETARGS, XGETARG, and XPUTARG.

History

2009 September, A-Shell 5.1.1159:  Routine modified to support returning data into dynamic variables, such that they expand as needed. Previously, the output data was being truncated to the current size of the variable, or 0 for uninitialized.