home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / util / rexx / MOOS.lha / MOOS / Tests / rexx_reqtools.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-02-26  |  3.5 KB  |  152 lines

  1. /*
  2.  * rexx_dos.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. CALL print(20,'-','RqtFileReq(,,"Flags=patgad|save")')
  47. SAY RqtFileReq(,,"Flags=patgad|save")
  48.  
  49. opts = 'Dir Devs: Pat #?.device Stem req.'
  50. CALL print(20,'-','RqtFileReq(,,'opts')')
  51. SAY RqtFileReq(,,opts)
  52. SAY "req.FileName ==" req.FileName
  53. SAY "req.Drawer   ==" req.Drawer
  54. SAY "req.Pattern  ==" req.Pattern
  55.  
  56. DROP req.
  57.  
  58.  
  59. /*
  60.  *    RqtFontReq()
  61.  */
  62. CALL print(4,'#',"RqtFontReq(options)")
  63.  
  64. CALL print(20,'-',"RqtFontReq('Stem fo. Flags=scale')")
  65. CALL RqtFontReq('Stem fo. Flags=scale')
  66. SAY "fo.Name     ==" fo.Name
  67. SAY "fo.YSize    ==" fo.YSize
  68. SAY "fo.Style    ==" fo.Style
  69. SAY "fo.Flags    ==" fo.Flags
  70.  
  71. DROP fo.
  72.  
  73.  
  74. /*
  75.  *    RqtLongReq()
  76.  */
  77. CALL print(4,'#',"RqtLongReq(bodytext,options)")
  78.  
  79. opts = "Min 1 Max 100"
  80. body = "How old are you?"
  81. CALL print(20,'-','RqtLongReq("'body'",'opts')')
  82. SAY "You are" RqtLongReq(body,opts) "years old... :-)"
  83.  
  84.  
  85. /*
  86.  *    RqtStringReq()
  87.  */
  88. CALL print(4,'#',"RqtStringReq(bodytext,string,options)")
  89.  
  90. opts = "MaxL 32"
  91. body = "What's your name?"
  92. CALL print(20,'-','RqtStringReq("'body'",,'opts')')
  93. SAY "Your name is" RqtStringReq(body,,opts) ":-)"
  94.  
  95. opts = "MaxL 16 Hidden"
  96. body = "New password:"
  97. CALL print(20,'-','RqtStringReq("'body'",,'opts')')
  98. SAY "Your name is" RqtStringReq(body,,opts) ":-)"
  99.  
  100.  
  101. /*
  102.  *    RqtPaletteReq()
  103.  */
  104. CALL print(4,'#',"RqtPaletteReq(options)")
  105.  
  106. CALL print(20,'-','RqtPaletteReq(2)')
  107. SAY RqtPaletteReq(2)
  108.  
  109.  
  110. /*
  111.  *    RqtScreenReq()
  112.  */
  113. CALL print(4,'#',"RqtScreenReq()")
  114.  
  115. CALL print(20,'-','RqtScreenReq()')
  116. SAY RqtScreenReq()
  117.  
  118. opts = "Stem sm. Flags=sizegads"
  119. CALL print(20,'-','RqtScreenReq('opts')')
  120. SAY RqtScreenReq(opts)
  121. SAY "sm.DisplayID     ==" sm.DisplayID
  122. SAY "sm.DisplayWidth  ==" sm.DisplayWidth
  123. SAY "sm.DisplayHeight ==" sm.DisplayHeight
  124. SAY "sm.DisplayDepth  ==" sm.DisplayDepth
  125. SAY "sm.OverscanType  ==" sm.OverscanType
  126. SAY "sm.AutoScroll    ==" sm.AutoScroll
  127.  
  128. opts = "Stem sm. Flags=allgads"
  129. CALL print(20,'-','RqtScreenReq('opts')')
  130. SAY RqtScreenReq(opts)
  131. SAY "sm.DisplayID     ==" sm.DisplayID
  132. SAY "sm.DisplayWidth  ==" sm.DisplayWidth
  133. SAY "sm.DisplayHeight ==" sm.DisplayHeight
  134. SAY "sm.DisplayDepth  ==" sm.DisplayDepth
  135. SAY "sm.OverscanType  ==" sm.OverscanType
  136. SAY "sm.AutoScroll    ==" sm.AutoScroll
  137.  
  138. DROP sm.
  139.  
  140.                                                                               
  141.  
  142. ADDRESS COMMAND 'Wait' 2
  143.  
  144. SAY
  145. EXIT 0
  146.  
  147. print: PROCEDURE
  148.     PARSE ARG pos,char,str
  149.     IF char = '#' THEN SAY '0a0a'x
  150.     SAY COPIES(char,pos) || OVERLAY(" "str" ",COPIES(char,78 - pos))
  151.     RETURN
  152.