The sample code below should be entered inside the Edit window's Command mode and not inside the File I/O dialog box.
The following code asks for a file name to move and a location directory and file name to move to. It then performs the file move operation.
C1=COMMENT/INPUT,Please type a file you want to move.
,(Include full file path)
C2=COMMENT/INPUT,Please type a destination file name.
,(Include full file path)
V1=FILE/EXISTS,C1.INPUT
IF/V1<>0
COMMENT/OPER,File exists to move. File move commencing.
FILE/MOVE,C1.INPUT,C2.INPUT
V2=FILE/EXISTS,C2.INPUT
IF/V2==0
COMMENT/OPER,"File doesn't exist at: " + C2.INPUT
,The MOVE didn't function properly.
ROUTINE/END
END_IF/
ELSE/
COMMENT/OPER,File MOVE successful.
ROUTINE/END
END_ELSE/
END_IF/
COMMENT/OPER,Original file doesn't exist. Try again.
Code Explanation
Much of this code is similar to that explained in "Sample Code for File ".
Only explanations unique to this example are given here.
FILE/MOVE,C1.INPUT,C2.INPUT
This line copies the original file to a destination file. This command
takes two parameters.
Parameter 1 is C1.INPUT. This is the full path to the file to move.
Parameter 2 is C2.INPUT, or the full path to the destination file.
Command Mode Commands after Comments
After you insert a PC-DMIS comment, to type additional PC-DMIS commands in Command Mode, you must first press Enter twice after the COMMENT command. This tells PC-DMIS that you no longer want to add text to the comment but are ready to add a new command.