core

## Reading Text up to a Delimiter

The Insert | File I/O Command | Reading Commands | Read Up To menu option places a command in the Edit window that reads all text "up to" one of the given delimiters from the specified file during execution. Any text read by this command is placed in the specified destination variable. The command stops reading text when PC-DMIS encounters the following:

- Defined delimiters

- Carriage returns

- Line feed characters

If the end of the file is reached, the destination variable is set to "EOF" (End of File).

The syntax of this command in the Edit window is:

<varname> = FILE/READ_UPTO,<fptrname>,<delimiters>

Descriptions for some of the components of this command are:

<varname>
This is the name of the destination variable.

<fptrname>
This is the name specified for the file pointer when the file was opened.

<delimiters>
This is a string which contains zero or more delimiter characters.

To access the dialog box associated with this File I / O command:

1. Select the Edit Window to open the Edit window.

2. Place your cursor on the FILE/READ command.

3. Press F9. The File I/O dialog box opens.

Once the dialog box appears:

1. Type the variable name that receives the read in information into the Variable ID box.

2. Type the file pointer name into the File Pointer ID box.

3. Type the delimiter into the Text box (be sure and use quotation marks around your chosen delimiter).

4. Click OK.

More:

Sample Code for Read Up To