home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / rexx / 1468 < prev    next >
Encoding:
Text File  |  1993-01-08  |  2.1 KB  |  78 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!paladin.american.edu!auvm!UTMJB.BITNET!WAN
  3. Message-ID: <REXXLIST%93010723264204@OHSTVMA.ACS.OHIO-STATE.EDU>
  4. Newsgroups: comp.lang.rexx
  5. Date:         Fri, 8 Jan 1993 12:02:02 MAL
  6. Sender:       REXX Programming discussion list <REXXLIST@UGA.BITNET>
  7. From:         Wan Hasan Abdullah <WAN@UTMJB.BITNET>
  8. Subject:      Re: YWAKEUP EXAMPLES
  9. In-Reply-To:  Message of Thu, 7 Jan 1993 13:48:21 TUR from <YIGIT@TRMETU>
  10. Lines: 66
  11.  
  12. On Thu, 7 Jan 1993 13:48:21 TUR A.Ilkay Yigit said:
  13. >I just got the program YWAKEUP...
  14. >I need some example rexx programs using ywakeup. If you have any please
  15. >let me have a look at them.
  16. >
  17.  
  18. Hello A.Ilkay,
  19. --------------------------------------------------------------------------
  20. /*************************************************************************
  21.  *   This is just a short example of REXX program using YWAKEUP module.  *
  22.  *   Function: Display all incoming messages from the local nodeid as    *
  23.  *             well as accepting CP/CMS commands */                      *
  24.  *************************************************************************
  25. Trace 'O'
  26. 'STATE YWAKEUP MODULE *'
  27. If RC > 0 then do
  28.   If RC = 28 then
  29.     Say 'YWAKEUP MODULE not found'
  30.   Else
  31.     Say 'YUnknown error code='RC
  32.   Exit
  33. End
  34. 'YWAKEUP BEGIN *MSG'
  35. if RC > 0 then do
  36.   say 'YWAKEUP failed'
  37.   exit RC
  38. end
  39. 'CP SET RUN ON'
  40. 'CP SET MSG IUCV'
  41. Say 'Begins...'
  42. Do forever
  43.   'YWAKEUP +1 (*MSG CONS'
  44.   Select
  45.     When YWAKEUP.0 = 5 then call MSG
  46.     When YWAKEUP.0 = 3 then call CON
  47.     When YWAKEUP.0 = 2 then iterate
  48.     Otherwise do
  49.       'CP SET RUN OFF'
  50.       'CP SET MSG ON'
  51.       'YWAKEUP END *MSG'
  52.       Exit
  53.     End
  54.   End
  55. End
  56.  
  57. MSG:
  58. userid = STRIP(YWAKEUP.3)
  59. text = STRIP(YWAKEUP.4)
  60. Say YWAKEUP.2 'FROM' userid':' text
  61. Return
  62.  
  63. CON:
  64. If ABBREV('SHUTDOWN',TRANSLATE(YWAKEUP.3),4) then Do
  65.   'CP SET RUN OFF'
  66.   'CP SET MSG ON'
  67.   'YWAKEUP END *MSG'
  68.   Exit
  69. End
  70. YWAKEUP.3
  71. Return
  72. ------------------------------------------------------------------------
  73. All the best,
  74.  
  75. -WAN-
  76. Senior Programmer at Computer Center,
  77. University of Technology Malaysia, Johore Bahru/MALAYSIA
  78.