SetRecTerminator method: File class

Syntax

SetRecTerminator(Terminator)

Description

The SetRecTerminator method is a file layout method.

Use this method to specify the string of characters that indicate the end of a file record. Read operations use the value of SetRecTerminator to determine where each file record ends and the next one starts, and write operations append the value of SetRecTerminator to each record written.

This value defaults to the newline character appropriate to the platform where the file is being stored:

  • a linefeed on UNIX systems

  • a carriage return/linefeed combination on Windows systems

You need to specify a different record terminator only if you anticipate that part of the data in a file field that includes the newline character used on the storage platform; you must assign the record terminator a unique string that you know does not appear in a file field.

Note:

The segment terminator of a file record is not the same as its record terminator. The segment terminator occurs immediately after a single row of data; it is defined only at design time in the File Layout Designer. The record terminator occurs immediately after the segment terminator; it is defined only at runtime by the SetRecTerminator method of the File class.

See Application Designer Developer’s Guide: Specifying File Record Properties for information on the segment terminator.

Parameters

Parameter Description

Terminator

Specify the value you want used for the record terminator.

Returns

None.

Example

&File = GetFile(......);

if &File.IsOpen then
   /* set the terminator to be space */
   Local String &Term = " "; 
   &File.SetRecTerminator(&Term);