home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / util1 / pwrbt14e.lzh / MOVE1.PWR < prev    next >
Text File  |  1990-12-01  |  2KB  |  40 lines

  1. Variable        CLP%1,79,"a"                    ;command line parm %1
  2. Variable        CLP%2,79,"a"                    ;%2
  3. Variable        InChar,1                        ;for keyboard responses
  4. Compare         CLP%1,"a",,,Syntax              ;show syntax
  5. Compare         CLP%2,"a",,,Syntax
  6. Clear                                           ;clear the screen
  7. Upper           CLP%1                           ;make CLP%1 upper case
  8. Upper           CLP%2                           ;make CLP%2 upper case
  9. Write           "Move "                         ;build initial msg
  10. Write           CLP%1
  11. Write           " to "
  12. WriteLine       CLP%2
  13. ?FileExist      CLP%1,File1OK                   ;does source file exist
  14. Write           CLP%1                           ;write error msg
  15. WriteLine       " not found."
  16. GoTo            BadCopy
  17. Label           File1OK
  18. ?FileExist      CLP%2,,File2OK                  ;does destination file exist
  19. Write           CLP%2                           ;write error msg
  20. WriteLine       " exists!"
  21. ReadYN          "Overwrite? [Y/N] ",InChar
  22. WriteLine       ""
  23. Compare         InChar,"N",,,BadCopy
  24. Label           File2OK
  25. Compare         CLP%1,CLP%2,,,DupFiles          ;cannot copy to itself
  26. Copy            CLP%1 CLP%2                     ;DOS copy command
  27. ?FileExist      CLP%2,,BadCopy                  ;did output file make it OK
  28. Write           "Erasing "                      ;tell user we are erasing source
  29. WriteLine       CLP%1
  30. Erase           CLP%1                           ;DOS erase command
  31. WriteLine       "Move successful"               ;msg to user
  32. Halt
  33. Label           DupFiles
  34. WriteLine       "Cannot move a file to itself"
  35. Label           BadCopy                         ;unsuccessful comes to here
  36. WriteLine       "Move unsuccessful"
  37. Halt
  38. Label           Syntax
  39. WriteLine       "Syntax is Move1 SourceFileName TargetFileName"
  40.