home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / njpipes.zip / template1.nrx < prev    next >
Text File  |  1998-08-30  |  918b  |  43 lines

  1. /* uncomment package if this code is in a subdirectory of one on your classpath
  2.  * and change xxxx to the name of the subdirectory
  3.  */
  4. -- package xxxx
  5.  
  6. options binary
  7.  
  8. import pipes.
  9.  
  10. class template1 extends stage
  11.  
  12. /* run a basic stage that has very little setup to do */
  13.  
  14. method run()
  15.  
  16.    /* insert objects that need to be reset every invokation here */
  17.  
  18.    rc = 0
  19.  
  20.    do -- to catch the terminating StageError
  21.  
  22.       /* setup code goes here
  23.        *
  24.        * if there are setup problems then
  25.        *    signal StageError(11,'termplate1 had this error')
  26.        *
  27.        */
  28.  
  29.       /* body of the stage is here */
  30.  
  31.       loop forever
  32.          object = peekto()        -- pass objects of any class
  33.          output(object)
  34.          readto()
  35.       end
  36.  
  37.    catch e=StageError
  38.    end
  39.  
  40.    rc = rc(e)     -- extract the rc from the StageError and update stage's rc
  41.  
  42. exit(rc*(rc<>12))
  43.