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

  1. /*-- REXX ------------------------------------------------------------*/
  2. /*                                                                    */
  3. /* Module name: PRXTEST1.CMD                                          */
  4. /*                                                                    */
  5. /* Function:    Test PRXUTILS.DLL file 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. /* add all PRXUTILS functions */
  32. call RxFuncAdd 'PrxLoadFuncs', 'PRXUTILS', 'PRXLOADFUNCS'
  33. call PrxLoadFuncs
  34. say; say 'Functions loaded.'
  35.  
  36.  
  37. /* give greetings */
  38. vers_string = PrxUtilsVersion()
  39. parse var vers_string vers versdate
  40. vers_string = 'This is a test cmd for PRXUTILS.DLL Version'
  41. vers_string = vers_string vers 'dated' versdate'.'
  42. say; say vers_string
  43. call Pause
  44.  
  45. /* test PrxCopyFile() */
  46. say; say "Testing PrxCopyFile() by creating the file 'Rextemp1.fil':"
  47. say "Copying 'c:\config.sys' to 'rextemp1.fil'."
  48. retc = PrxCopyFile('c:\config.sys', 'Rextemp1.fil')
  49. say 'The return code from PrxCopyFile() was' retc
  50. call Pause
  51.  
  52. /* test PrxReadToStem */
  53. say; say "Testing PrxReadToStem() by reading in 'C:\CONFIG.SYS':"
  54. retc = PrxReadToStem('c:\config.sys', 'file')
  55. say 'The return code from PrxReadToStem() was' retc
  56. say 'The number of lines in the file is' file.0'.'
  57. say 'The listing of the file follows:'
  58. call Pause
  59. do num = 1 to file.0
  60.   say file.num
  61.   end
  62. call Pause
  63.  
  64. /* test PrxWriteFromStem */
  65. say; say "Testing PrxWriteFromStem() by creating the file 'Rextemp.fil':"
  66. retc = PrxWriteFromStem('Rextemp.fil', 'file', file.0, , 'r')
  67. say 'The return code from PrxWriteFromStem() was' retc
  68. call Pause
  69.  
  70. /* test PrxMoveFile */
  71. say; say "Testing PrxMoveFile() by renaming 'Rextemp.fil' to 'Rextemp2.fil':"
  72. retc = PrxMoveFile('Rextemp.fil', 'Rextemp2.fil')
  73. say 'The return code from PrxMoveFile() was' retc
  74. call Pause
  75.  
  76. /* give salutations */
  77. say; say 'PrxUtils test complete.'
  78. say 'Deleting temporary files.'
  79. '@del Rextemp1.fil'
  80. '@del Rextemp2.fil'
  81. say 'Bye'
  82. exit 0
  83.  
  84.  
  85. /*--------------------------------------------------------------------*/
  86. /* Subroutines are below:                                             */
  87. /*--------------------------------------------------------------------*/
  88.  
  89. Pause: procedure
  90. /* prompt user and pause */
  91. say 'Press Return to continue'
  92. newline = linein()
  93. return
  94.  
  95.