home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / PRXUTILS.ZIP / PRXTEST4.CMD < prev    next >
OS/2 REXX Batch file  |  1992-06-28  |  4KB  |  136 lines

  1. /*-- REXX ------------------------------------------------------------*/
  2. /*                                                                    */
  3. /* Module name: PRXTEST4.CMD                                          */
  4. /*                                                                    */
  5. /* Function:    Test exec for PRXUTILS.DLL VIO functions.             */
  6. /*                                                                    */
  7. /* Author:      W. David Ashley                                       */
  8. /*                                                                    */
  9. /* (C) Copyright Pedagogic Software 1992.  All rights reserved.       */
  10. /*                                                                    */
  11. /* Modifications:                                                     */
  12. /* --------  ---  --------------------------------------------------- */
  13. /* 06/28/92  WDA  Initial Release                                     */
  14. /*                                                                    */
  15. /*--------------------------------------------------------------------*/
  16.  
  17.  
  18. /* get any input options */
  19. if arg() = 1 then arg opt
  20. else opt = ''
  21.  
  22. /* drop functions if necessary */
  23. if opt = 'DELETE' then do
  24.    if rxfuncquery('PrxDropFuncs') then ,
  25.     call RxFuncAdd 'PrxDropFuncs', 'PRXUTILS', 'PRXDROPFUNCS'
  26.    call PrxDropFuncs
  27.    say; say 'Functions dropped.'
  28.    exit 0
  29.    end
  30.  
  31.  
  32. /* add all PRXUTILS functions */
  33. call RxFuncAdd 'PrxLoadFuncs', 'PRXUTILS', 'PRXLOADFUNCS'
  34. call PrxLoadFuncs
  35. say; say 'Functions loaded.'
  36.  
  37.  
  38. /* give greetings */
  39. vers_string = PrxUtilsVersion()
  40. parse var vers_string vers versdate
  41. vers_string = 'This is a test cmd for PRXUTILS.DLL Version'
  42. vers_string = vers_string vers 'dated' versdate'.'
  43. say; say vers_string
  44. call Pause
  45.  
  46.  
  47. /* get screen mode settings */
  48. '@CLS'
  49. mode = PrxGetMode()
  50. parse var mode type colors cols rows hres vres
  51. say 'The screen type is' type
  52. say 'The number of colors is' colors
  53. say 'The number of columns is' cols
  54. say 'The number of rows is' rows
  55. say 'The horizontal resolution is' hres
  56. say 'The vertical resolution is' vres
  57. call Pause
  58.  
  59.  
  60. /* fill screen with characters */
  61. '@CLS'
  62. call PrxWrtNChar 'A', cols*(rows-3), 0, 0
  63. call PrxWrtCharStr copies(' ', cols), rows-3, 0
  64. call PrxWrtCharStr "Screen filled with 'A' characters.", rows-3, 0
  65. call PrxWrtCharStr copies(' ', cols), rows-2, 0
  66. call PrxSetCurPos rows-2, 0
  67. call PrxWrtTTY 'Press any key to continue...'
  68. newline = linein()
  69.  
  70.  
  71. /* change the attribute */
  72. call PrxWrtNAttr x2c('72'), cols*(rows-3), 0, 0
  73. call PrxWrtCharStr copies(' ', cols), rows-3, 0
  74. call PrxWrtCharStr "Attributes changed to green on white.", rows-3, 0
  75. call PrxSetCurPos rows-2, 0
  76. call PrxWrtTTY 'Press any key to continue...'
  77. newline = linein()
  78.  
  79.  
  80. /* scroll up */
  81. fill = 'B' || x2c('72')
  82. call PrxScrollUp 0, 0, rows-4, cols, 4, fill
  83. call PrxWrtCharStr copies(' ', cols), rows-3, 0
  84. call PrxWrtCharStr "Screen scrolled up 4 lines with 'B' fill.", rows-3, 0
  85. call PrxSetCurPos rows-2, 0
  86. call PrxWrtTTY 'Press any key to continue...'
  87. newline = linein()
  88.  
  89.  
  90. /* scroll down */
  91. fill = 'C' || x2c('72')
  92. call PrxScrollDn 0, 0, rows-4, cols, 2, fill
  93. call PrxWrtCharStr copies(' ', cols), rows-3, 0
  94. call PrxWrtCharStr "Screen scrolled down 2 lines with 'C' fill.", rows-3, 0
  95. call PrxSetCurPos rows-2, 0
  96. call PrxWrtTTY 'Press any key to continue...'
  97. newline = linein()
  98.  
  99.  
  100. /* scroll left */
  101. fill = 'D' || x2c('72')
  102. call PrxScrollLf 0, 0, rows-4, cols, 10, fill
  103. call PrxWrtCharStr copies(' ', cols), rows-3, 0
  104. call PrxWrtCharStr "Screen scrolled left 10 cols with 'D' fill.", rows-3, 0
  105. call PrxSetCurPos rows-2, 0
  106. call PrxWrtTTY 'Press any key to continue...'
  107. newline = linein()
  108.  
  109.  
  110. /* scroll right */
  111. fill = 'E' || x2c('72')
  112. call PrxScrollRt 0, 0, rows-4, cols, 5, fill
  113. call PrxWrtCharStr copies(' ', cols), rows-3, 0
  114. call PrxWrtCharStr "Screen scrolled right 5 cols with 'E' fill.", rows-3, 0
  115. call PrxSetCurPos rows-2, 0
  116. call PrxWrtTTY 'Press any key to continue...'
  117. newline = linein()
  118.  
  119.  
  120. /* give salutations */
  121. say; say 'PrxUtils test complete.'
  122. say 'Bye'
  123. exit 0
  124.  
  125.  
  126. /*--------------------------------------------------------------------*/
  127. /* Subroutines are below:                                             */
  128. /*--------------------------------------------------------------------*/
  129.  
  130. Pause: procedure
  131. /* prompt user and pause */
  132. say 'Press Return to continue'
  133. newline = linein()
  134. return
  135.  
  136.