home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / samples / rexx / api / rxmacdll / rxmacdll.cmd < prev    next >
OS/2 REXX Batch file  |  1999-05-11  |  2KB  |  62 lines

  1. /*********************************************************************/
  2. /*   RXMACDLL.CMD - Builds macrospace access functions dynamic link  */
  3. /*                  library for REXXSAA                              */
  4. /*********************************************************************/
  5.  
  6.  
  7. Say 'This program demonstrates the MacroSpace and NLS function '
  8. Say '  libraries for REXX.'
  9. Say
  10. Say 'Required Programs:'
  11. Say ' MACRO.DLL'
  12. Say ' RXNLSINF.DLL'
  13. Say ' NLSMONEY.CMD'
  14. Say
  15.  
  16. Address CMD '@PAUSE'
  17. Say 'The MacroSpace utility library contains the functions:'
  18. Say
  19. Say '       MACROLOAD     - Load a file into the MacroSpace'
  20. Say '       MACROSAVE     - Save the MacroSpace to a Library'
  21. Say '       MACROERASE    - Erase the Contents of the MacroSpace'
  22. Say '       MACROQUERY    - Query a Function in the MacroSpace'
  23. Say
  24. Say 'The NLS utility library  contains the function:'
  25. Say
  26. Say '       RxNLSInfo     - Retrieve NLS information'
  27. Say
  28. Say 'Now this program will call the functions.'
  29. Address CMD '@PAUSE'
  30.  
  31. D.1 = 'MacroLoad';          D.2 = 'MacroSave'
  32. D.3 = 'MacroErase';         D.4 = 'MacroQuery'
  33.  
  34. /* To use the new functions from REXX, we must "register" them   */
  35. /* by using RxFuncAdd.                                           */
  36. Do I=1 to 4
  37.    if RxFuncQuery(D.I) Then Call RxFuncAdd D.I, 'MACRO', D.I
  38. End /* do */
  39.  
  40. amounts = '1000 1000.00 0 .12 .456 1000000 123456 123456.78'
  41.  
  42. call MacroLoad 'NLSMoney BEFORE NLSMoney'
  43.  
  44. numamt = words( amounts )
  45.  
  46. do i = 1 to numamt
  47.  
  48.   amount = word( amounts, i )
  49.   fmtamt = NLSMoney( amount )
  50.  
  51.   say "The amount" amount "formats as" fmtamt || "."
  52. end
  53.  
  54. call MacroErase
  55. Do I = 1 to 4
  56.    Call RxFuncDrop D.I
  57. End
  58. Call RxFuncDrop RxNLSInfo
  59. Address CMD '@PAUSE'
  60.  
  61.  
  62.