home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 01e / let12.zip / DEMO-9.BAT < prev    next >
DOS Batch File  |  1987-09-17  |  1KB  |  34 lines

  1. echo Off
  2. If `%Name%' == `' Demo
  3. cls
  4. echo   ╔════════════════════════════════════════════════════════════════╗
  5. echo ┌─╫────────────────────────────────────────────────────────────────╫─┐
  6. echo │ ║   File Specification Parsing: FILESPEC                         ║ │
  7. echo └─╫────────────────────────────────────────────────────────────────╫─┘
  8. echo   ╚════════════════════════════════════════════════════════════════╝
  9. echo  
  10. echo Now we turn to a neat little feature that LET has to offer: file-name
  11. echo parsing.  Given a file-name, we can `explode' it into its constituent
  12. echo parts: the drive, the (absolute) path, the file's name, and its
  13. echo extension.  For example, I am going to ask for a file specification
  14. echo below.  You can give me any portion(s) you want: you can omit the
  15. echo path, for example, or give me a relative or absolute path.  You can
  16. echo omit the drive, or specify it.  Whatever.
  17. echo  
  18. LET dummy=(do "filespec")
  19. echo I get the following parts:
  20. echo   Drive: %fileDrive%
  21. echo   Path:  %filePath%  (this is from the root)
  22. echo   Name:  %fileName%
  23. echo   Ext:   %fileExt%
  24. echo Put all together, you would have "%file2%".
  25. echo  
  26. set file=
  27. set fileDrive=
  28. set filePath=
  29. set fileName=
  30. set fileExt=
  31. set file2=
  32. pause
  33. DEMO-10
  34.