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

  1. /*-- REXX ------------------------------------------------------------*/
  2. /*                                                                    */
  3. /* Module name: PRXTEST2.CMD                                          */
  4. /*                                                                    */
  5. /* Function:    Test PRXUTILS date manipulation 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 PrxDateToBase() */
  46. say; say "Testing PrxDateToBase():"
  47. say "The current date('b') date is" date('b')
  48. x = "The current PrxDateToBase("
  49. say x || "date()) base date is" PrxDateToBase(date())
  50. say x || "date('l'), 'l') base date is" PrxDateToBase(date('l'), 'l')
  51. say x || "date('n'), 'n') base date is" PrxDateToBase(date('n'), 'n')
  52. say x || "date('s'), 's') base date is" PrxDateToBase(date('s'), 's')
  53. say
  54. call Pause
  55.  
  56. /* test PrxBaseToDate() */
  57. say; say "Testing PrxDateToBase():"
  58. today = '1 January 1988'
  59. base = PrxDateToBase(today, 'l')
  60. say 'The base date for' today 'is' base
  61. say "The PrxBaseToDate("base") date is" PrxBaseToDate(base)
  62. say
  63. today = '31 December 1988'
  64. base = PrxDateToBase(today, 'l')
  65. say 'The base date for' today 'is' base
  66. say "The PrxBaseToDate("base",'l') date is" PrxBaseToDate(base, 'l')
  67. say
  68. today = '1 June 1989'
  69. base = PrxDateToBase(today, 'l')
  70. say 'The base date for' today 'is' base
  71. say "The PrxBaseToDate("base",'s') date is" PrxBaseToDate(base, 's')
  72. say
  73. today = '15 November 1989'
  74. base = PrxDateToBase(today, 'l')
  75. say 'The base date for' today 'is' base
  76. say "The PrxBaseToDate("base",'n') date is" PrxBaseToDate(base, 'n')
  77. say
  78. today = '29 Febuary 1992'
  79. base = PrxDateToBase(today, 'l')
  80. say 'The base date for' today 'is' base
  81. say "The PrxBaseToDate("base") date is" PrxBaseToDate(base)
  82. say
  83. call Pause
  84.  
  85. /* give salutations */
  86. say; say 'PrxUtils test complete.'
  87. say 'Bye'
  88. exit 0
  89.  
  90.  
  91. /*--------------------------------------------------------------------*/
  92. /* Subroutines are below:                                             */
  93. /*--------------------------------------------------------------------*/
  94.  
  95. Pause: procedure
  96. /* prompt user and pause */
  97. say 'Press Return to continue'
  98. newline = linein()
  99. return
  100.  
  101.