Sample Code for File Open

The sample code below should be entered inside the Edit window's Command mode and not inside the File I/O dialog box.

This code opens a file named TEST.TXT for reading, writing, and appending. It stores the file name to a file pointer named FPTR.

FPTR=FILE/OPEN,C:\PCDMISW\TEST.TXT,READ

FPTR=FILE/OPEN,C:\PCDMISW\TEST.TXT,WRITE

FPTR=FILE/OPEN,C:\PCDMISW\TEST.TXT,APPEND

Be aware that you can use an input comment to take the full pathway as an input and use it in a FILE/OPEN command. You can also do the same thing by using the FILE/DIALOG command. Consider these examples:

C1=COMMENT/INPUT,Type the full pathway and name of the file.

V1=FILE/DIALOG, CHOOSE A FILE TO OPEN

FPTR=FILE/OPEN,C1.INPUT,READ

FPTR=FILE/OPEN,V1,READ

See "Displaying a File Dialog Box".

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.