MIAMEX 81: Get / Set params in SBX

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

This function provides a means for an SBX to retrieve parameters passed to it from the calling program, and to pass parameters back. It remains supported but has been deprecated since A-Shell version 6.0, having been superseded by the family of X-ARGs which offer several advantages, including working with Functions and Procedures as well as SBXs. See MX_XCBDATAX for details on migration to the newer statements.

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)

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.

See Also

•   The documentation on writing SBX Subroutines, Development Steps.

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.