home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / filerx11.zip / getpath.cmd < prev    next >
OS/2 REXX Batch file  |  1995-02-11  |  1KB  |  32 lines

  1. /******************************************************************
  2.  * PATH.CMD
  3.  *
  4.  * This program calls the various REXX external functions provided in the FILEREXX DLL.
  5.  *******************************************************************/
  6.  
  7.  
  8. /* The FileLoadFuncs loads all the rest of the REXX functions in the FILEREXX DLL. */
  9. /* So, we don't have to make calls to RxFuncAdd to add each one of those functions. Of */
  10. /* course, in order to call FileLoadFuncs, we have to add that one. */
  11. CALL RxFuncAdd 'FileLoadFuncs', 'FILEREXX', 'FileLoadFuncs'
  12. CALL FileLoadFuncs
  13.  
  14. /* ============================== FileGetPath ============================ */
  15. /* Split up the filespec that the user types on the command line when invoking this script.
  16.     If he doesn't type any filespec, get the current path */
  17. arg myspec
  18. err = FileGetPath('Info', myspec, 'CHK')
  19. IF err = 0 THEN DO
  20.     SAY "Drive =" Info.0
  21.     SAY "Path =" Info.1
  22.     SAY "Filename =" Info.2
  23.     SAY "Extension =" Info.3
  24. END
  25. ELSE SAY  "FileGetPath('Info', '"myspec"') =" err
  26.  
  27.  
  28. /* =============================================================================== */
  29. /* FileDropFuncs: This unloads all of the functions in the FILEREXX DLL. This is not necessary, and
  30.     we could otherwise leave it open for some other REXX script */
  31. CALL FileDropFuncs
  32.