home *** CD-ROM | disk | FTP | other *** search
- Variable CLP%1,79,"a" ;command line parm %1
- Variable CLP%2,79,"a" ;%2
- Variable InChar,1 ;for keyboard responses
- Compare CLP%1,"a",,,Syntax ;show syntax
- Compare CLP%2,"a",,,Syntax
- Clear ;clear the screen
- Upper CLP%1 ;make CLP%1 upper case
- Upper CLP%2 ;make CLP%2 upper case
- Write "Move " ;build initial msg
- Write CLP%1
- Write " to "
- WriteLine CLP%2
- ?FileExist CLP%1,File1OK ;does source file exist
- Write CLP%1 ;write error msg
- WriteLine " not found."
- GoTo BadCopy
- Label File1OK
- ?FileExist CLP%2,,File2OK ;does destination file exist
- Write CLP%2 ;write error msg
- WriteLine " exists!"
- ReadYN "Overwrite? [Y/N] ",InChar
- WriteLine ""
- Compare InChar,"N",,,BadCopy
- Label File2OK
- Compare CLP%1,CLP%2,,,DupFiles ;cannot copy to itself
- Copy CLP%1 CLP%2 ;DOS copy command
- ?FileExist CLP%2,,BadCopy ;did output file make it OK
- Write "Erasing " ;tell user we are erasing source
- WriteLine CLP%1
- Erase CLP%1 ;DOS erase command
- WriteLine "Move successful" ;msg to user
- Halt
- Label DupFiles
- WriteLine "Cannot move a file to itself"
- Label BadCopy ;unsuccessful comes to here
- WriteLine "Move unsuccessful"
- Halt
- Label Syntax
- WriteLine "Syntax is Move1 SourceFileName TargetFileName"
-