home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
594a.lha
/
IP_Interface_example
/
neg.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-01-03
|
2KB
|
56 lines
/*
* NEG.rexx a simple P.I. module intended as an example for developers
*
* Written by: Barry Chalmers
* Last Update: January 1st, 1992
* Revision: 1.1
* For: Black Belt Systems image processing series IM, IM F/c, and IP.
*/
/*
* Always include this block of code which loads the libraries:
*/
if ~show('L',"rexxsupport.library") then do
if addlib('rexxsupport.library',0,-30,0) then do
/* everything's ok */
end;
else do
say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
say 'Cannot operate this module without the library - sorry!';
exit 10;
end;
end;
/*
* Always include this block of code which automatically assigns the ARexx
* port to the image processor that is running (there are several choices!)
*/
prtnme = 'IP_Port'; /* assume Image Professional */
if show('P','IP_Port') = 0 then do
if show('P','IM_Port') = 0 then do
say "Can't find image processor's ARexx port!!!"; /* not running? */
say "This script requires IP, IM or IM F/c to run!";
exit(20);
end;
else do
prtnme = 'IM_Port'; /* Imagemaster or Imagemaster F/c */
end;
end;
/*
* The function-specific portion of the script begins here:
* --------------------------------------------------------
*/
address(prtnme); /* communicate with image processor we found */
'area'; /* have user specify the area they want to affect */
options results; /* allow return values from command we're about to do */
'jackin'; /* attach to image processor's internal data structure */
jackptr = result; /* fetch the return value from the std ARexx return */
options; /* disallow return values from further commands */
address command; /* communicate with Amiga SHELL, we're going to use it */
'negative '||jackptr; /* run the SHELL command that does the actual work */
address(prtnme); /* communicate with image processor again */
'redraw'; /* redraw the screen so user sees results of command */
exit 0; /* Done. That's all there is to most PI Modules! */