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 >
OS/2 REXX Batch file  |  1992-01-03  |  2KB  |  56 lines

  1. /*
  2.  * NEG.rexx   a simple P.I. module intended as an example for developers
  3.  *
  4.  *  Written by: Barry Chalmers
  5.  * Last Update: January 1st, 1992
  6.  *    Revision: 1.1
  7.  *         For: Black Belt Systems image processing series IM, IM F/c, and IP.
  8.  */
  9.  
  10. /* 
  11.  * Always include this block of code which loads the libraries:
  12.  */
  13. if ~show('L',"rexxsupport.library") then do
  14.   if addlib('rexxsupport.library',0,-30,0) then do
  15.       /* everything's ok */
  16.     end;
  17.   else do
  18.     say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
  19.     say 'Cannot operate this module without the library - sorry!';
  20.     exit 10;
  21.     end;
  22.   end;
  23.  
  24. /*
  25.  * Always include this block of code which automatically assigns the ARexx
  26.  * port to the image processor that is running (there are several choices!)
  27.  */
  28. prtnme = 'IP_Port'; /* assume Image Professional */
  29. if show('P','IP_Port') = 0 then do
  30.   if show('P','IM_Port') = 0 then do
  31.     say "Can't find image processor's ARexx port!!!"; /* not running? */
  32.     say "This script requires IP, IM or IM F/c to run!";
  33.     exit(20);
  34.     end;
  35.   else do
  36.     prtnme = 'IM_Port'; /* Imagemaster or Imagemaster F/c */
  37.     end;
  38.   end;
  39.  
  40. /*
  41.  * The function-specific portion of the script begins here:
  42.  * --------------------------------------------------------
  43.  */
  44.  
  45. address(prtnme);      /* communicate with image processor we found           */
  46. 'area';               /* have user specify the area they want to affect      */
  47. options results;      /* allow return values from command we're about to do  */
  48. 'jackin';             /* attach to image processor's internal data structure */
  49. jackptr = result;     /* fetch the return value from the std ARexx return    */
  50. options;              /* disallow return values from further commands        */
  51. address command;      /* communicate with Amiga SHELL, we're going to use it */
  52. 'negative '||jackptr; /* run the SHELL command that does the actual work     */
  53. address(prtnme);      /* communicate with image processor again              */
  54. 'redraw';             /* redraw the screen so user sees results of command   */
  55. exit 0;               /* Done. That's all there is to most PI Modules!       */
  56.