home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / arexx / moos / demos / rexx_reqtools.rexx < prev    next >
OS/2 REXX Batch file  |  1997-03-25  |  4KB  |  155 lines

  1. /*
  2.  * rexx_[SUB].library
  3.  *
  4.  * Test file...
  5.  */
  6.  
  7. OPTIONS RESULTS
  8. lib = 'rexxMOOS.library'; IF ~SHOW('L',lib) THEN CALL ADDLIB(lib,100,-30)
  9.  
  10.                                                                               
  11. /*
  12.  *    RqtEasyReq()
  13.  */
  14. CALL print(4,'#',"RqtEasyReq(bodytext,options)")
  15.  
  16. gad.0 = "No_no..."; gad.1 = "_One"; gad.2 = "_Two"; gad.3 = "T_hree"
  17. gads  = gad.1"|"gad.2"|"gad.3"|"gad.0
  18. CALL print(20,'-','RqtEasyReq("Hello",'gads')')
  19. CALL RqtEasyReq("Hello",''gads'')
  20. SAY "You pressed '"COMPRESS(gad.result,"_")"'"
  21.  
  22. body =    "Press any mouse button (IDCMP = mousebuttons)" || '0a'x ||,
  23.         "into the requester to close it or" || '0a'x ||,
  24.         "press any key (IDCMP = rawkey)..."
  25. CALL print(20,'-','RqtEasyReq(body,"idcmp=mousebuttons|rawkey")')
  26. SAY RqtEasyReq(body,'idcmp=mousebuttons|rawkey')
  27.  
  28. DROP gad.
  29.  
  30.  
  31. /*
  32.  *    RqtFileReq()
  33.  */
  34. CALL print(4,'#',"RqtFileReq(filename,directory,options)")
  35.  
  36. CALL print(20,'-','RqtFileReq(,,"Stem req.* Flags=multi")')
  37. IF RqtFileReq(,,"Stem req.* Flags=multi") ~= "" THEN DO
  38.     SAY "req.FileName ==" req.FileName
  39.     SAY "req.Drawer   ==" req.Drawer
  40.     SAY "req.Pattern  ==" req.Pattern
  41.     DO n = 1 FOR req.0
  42.         SAY "req."n "==" req.n
  43.     END
  44. END
  45.  
  46. DROP req.
  47.  
  48. CALL print(20,'-','RqtFileReq(,,"Flags=patgad|save")')
  49. SAY RqtFileReq(,,"Flags=patgad|save")
  50.  
  51. dir  = "DEVS:"
  52. opts = "Pat #?.device Stem req."
  53. CALL print(20,'-','RqtFileReq(,'dir','opts')')
  54. SAY RqtFileReq(,dir,opts)
  55. SAY "req.FileName ==" req.FileName
  56. SAY "req.Drawer   ==" req.Drawer
  57. SAY "req.Pattern  ==" req.Pattern
  58.  
  59. DROP req.
  60.  
  61.  
  62. /*
  63.  *    RqtFontReq()
  64.  */
  65. CALL print(4,'#',"RqtFontReq(options)")
  66.  
  67. CALL print(20,'-',"RqtFontReq('Stem fo. Flags=scale')")
  68. CALL RqtFontReq('Stem fo. Flags=scale')
  69. SAY "fo.Name     ==" fo.Name
  70. SAY "fo.YSize    ==" fo.YSize
  71. SAY "fo.Style    ==" fo.Style
  72. SAY "fo.Flags    ==" fo.Flags
  73.  
  74. DROP fo.
  75.  
  76.  
  77. /*
  78.  *    RqtLongReq()
  79.  */
  80. CALL print(4,'#',"RqtLongReq(bodytext,options)")
  81.  
  82. opts = "Min 1 Max 100"
  83. body = "How old are you?"
  84. CALL print(20,'-','RqtLongReq("'body'",'opts')')
  85. SAY "You are" RqtLongReq(body,opts) "years old... :-)"
  86.  
  87.  
  88. /*
  89.  *    RqtStringReq()
  90.  */
  91. CALL print(4,'#',"RqtStringReq(bodytext,string,options)")
  92.  
  93. opts = "MaxL 32"
  94. body = "What's your name?"
  95. CALL print(20,'-','RqtStringReq("'body'",,'opts')')
  96. SAY "Your name is" RqtStringReq(body,,opts) ":-)"
  97.  
  98. opts = "MaxL 16 Hidden"
  99. body = "New password:"
  100. CALL print(20,'-','RqtStringReq("'body'",,'opts')')
  101. SAY RqtStringReq(body,,opts)
  102.  
  103.  
  104. /*
  105.  *    RqtPaletteReq()
  106.  */
  107. CALL print(4,'#',"RqtPaletteReq(options)")
  108.  
  109. CALL print(20,'-','RqtPaletteReq(2)')
  110. SAY RqtPaletteReq(2)
  111.  
  112.  
  113. /*
  114.  *    RqtScreenReq()
  115.  */
  116. CALL print(4,'#',"RqtScreenReq()")
  117.  
  118. CALL print(20,'-','RqtScreenReq()')
  119. SAY RqtScreenReq()
  120.  
  121. opts = "Stem sm. Flags=sizegads"
  122. CALL print(20,'-','RqtScreenReq('opts')')
  123. SAY RqtScreenReq(opts)
  124. SAY "sm.DisplayID     ==" sm.DisplayID
  125. SAY "sm.DisplayWidth  ==" sm.DisplayWidth
  126. SAY "sm.DisplayHeight ==" sm.DisplayHeight
  127. SAY "sm.DisplayDepth  ==" sm.DisplayDepth
  128. SAY "sm.OverscanType  ==" sm.OverscanType
  129. SAY "sm.AutoScroll    ==" sm.AutoScroll
  130.  
  131. opts = "Stem sm. Flags=allgads"
  132. CALL print(20,'-','RqtScreenReq('opts')')
  133. SAY RqtScreenReq(opts)
  134. SAY "sm.DisplayID     ==" sm.DisplayID
  135. SAY "sm.DisplayWidth  ==" sm.DisplayWidth
  136. SAY "sm.DisplayHeight ==" sm.DisplayHeight
  137. SAY "sm.DisplayDepth  ==" sm.DisplayDepth
  138. SAY "sm.OverscanType  ==" sm.OverscanType
  139. SAY "sm.AutoScroll    ==" sm.AutoScroll
  140.  
  141. DROP sm.
  142.  
  143.                                                                               
  144.  
  145. ADDRESS COMMAND 'Wait' 2
  146.  
  147. SAY
  148. EXIT 0
  149.  
  150. print: PROCEDURE
  151.     PARSE ARG pos,char,str
  152.     IF char = '#' THEN SAY '0a0a'x
  153.     SAY COPIES(char,pos) || OVERLAY(" "str" ",COPIES(char,78 - pos))
  154.     RETURN
  155.