Subject: | |
From: | |
Reply To: | |
Date: | Tue, 17 Mar 1998 15:38:03 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Here's an example replacing QUIT in C.
Program first!
/*----------------------------------------------------------------*/
/* QUIT Keven Miller 1998 Mar 17 */
/*----------------------------------------------------------------*/
#pragma list off
#pragma intrinsic QUIT mpe_quit
/*----------------------------------------------------------------*/
int main ( int argc, char* argv [] ) {
mpe_quit ( 7 );
}
/*----------------------------------------------------------------*/
compile: ccxllk quit.c,quit
test: qun quit
**** PROCESS QUIT; PARAM = 7
ABORT: QUIT.PUB.KEVENM
SYS % 162.0 ?TERMINATE (MItroc CCG) CMSWITCH
* 0) SYS % 162.0 ?TERMINATE (MItroc CCG) CMSWITCH
%2 (%113) cmdebug > Program terminated in an error state. (CIERR 976)
End Run
Next XL!
/*----------------------------------------------------------------*/
/* QUIT Keven Miller 1998 Mar 17 */
/*----------------------------------------------------------------*/
#pragma list off
#include <stdio.h>
#pragma intrinsic HPGETPROCPLABEL mpe_hpgetprocplabel
/*----------------------------------------------------------------*/
void QUIT ( short parm ) {
int err;
void (*mpe_quit)();
mpe_hpgetprocplabel ( "!QUIT!", &mpe_quit, &err,, 0 );
printf ( "Hey!!! Something called QUIT with %d\n", parm );
(*mpe_quit)( parm );
}
/*----------------------------------------------------------------*/
compile: ccxl quit1.c
makeXL: linkedit
>BUILDXL QXL;LIMIT=1
>ADDXL $OLDPASS
>exit
test: run quit;xl="qxl"
Hey!!! Something called QUIT with 7
**** PROCESS QUIT; PARAM = 7
ABORT: QUIT.PUB.KEVENM
SYS % 162.0 ?TERMINATE (MItroc CCG) CMSWITCH
* 0) SYS % 162.0 ?TERMINATE (MItroc CCG) CMSWITCH
%2 (%155) cmdebug > Program terminated in an error state. (CIERR 976)
End Run
With this example, you get 2 things!
Replace an intrinsic; and provide passthru to system intrinsic!
You could ignore the hpgetproclabel and call to system and just return
or whatever.
*********************
* Keven Miller KC7LYD
* [log in to unmask] (Salt Lake City, Utah, USA)
* ICQ 5721825
*********************
|
|
|