MIOS

When inputting or outputting data in CTO, it is possible to “intercept” and modify the data before it is processed by the normal CTO routines. This MIOS (Modified I/O System) is therefore comparable to OpenInsight’s MFS (Modified Filing System). Possible uses of this feature might be to implement i/o redirection, support for alternative input sources, or additional logging of output. To use this functionality, you must create a routine (or routines) that have the following parameters:

SUBROUTINE <routinename>(<code>,<mios chain>,<param1>,<param2>,<param3>,<param4>,<param5>,<param6>,<param7>,<param8>,<flag>)

Where the parameters are:

<code>: -1 = before input; 0 = input; 1 = before print; 2 = print

<mios chain>: Subvalue mark delimited list of other mios routines.

<param1> …: Parameters passed into DO_INPUT or DO_PRINT (depending on wheter this is –1/0 or 1/2 code)

<flag>: Set by the invoked MIOS routine. 0 indicates failure, any other value indicates success

You must specify that you want this routine invoked by calling SET_MIOS. SET_MIOS “attaches” your routine to the input/output chain of events. SET_MIOS has the following syntax:

SET_MIOS <routinename>,<calltype>

Calltype must be one of the following values:

1 – Add this routine to the end of the input/output chain

2 – Add this routine to the beginning of the input/output chain

3 – Add this routine to the front of the input/output chain (same as 2)

4 – Set this routine as the only routine in the input/output chain

5 – Remove this routine from the input/output chain

6 – Remove all routines from the input/output chain

Note that you must invoke SET_MIOS each time you log in to your application; therefore, you may wish to add this call to your LOGON proc or paragraph.