Please enable JavaScript to view this site.

ESL Documentation

FILEIO Subroutine

Define the number of columns between tab stops.

call SetTabSize(FILE_ID_IV, TAB_SIZE_IV)

FILE_ID_IV

An integer variable for the file id.

TAB_SIZE_IV

The number of columns between tab stops (greater or equal to zero and less than 64K).

If the tab size is set to zero then ESL will not convert tab characters to spaces and will instead, pass through the tab characters to the target string or record.

Description

The SetTabSize( ) subroutine allows you to specify the number of columns between tab stops. The default is eight. The tabs are especially important in records as the layout of the line is specific, and how any tabs present are translated into blanks can be crucial. Although tab sizes of up to 64K are supported, we do not recommend such large tab sizes.

Errors

FIO_E_NOTOPEN

File has not been opened. A file must be opened before a read attempt is made.

FIO_E_BADTABSIZE

Specified tab size out of range.

Example

integer FileID

integer BufferSize is 1024

integer IndexSize is 1024

integer TabSize is 5

include "fileio.inc"

 

# To be brief, error handling is omitted

 

response to line "Double Buffer" from keyboard

 copy (BufferSize * 2) to BufferSize

 call SetBufferSize (FileID, BufferSize)

 

response to line "Halve Buffer" from keyboard

 copy (BufferSize / 2) to BufferSize

 call SetBufferSize (FileID, BufferSize)

 

response to line "Double Index Size" from keyboard

 copy (IndexSize * 2) to IndexSize

 call SetIndexSize (FileID, IndexSize)

 

response to line "Halve Index Size" from keyboard

 copy (IndexSize / 2) to IndexSize

 call SetIndexSize (FileID, IndexSize)

 

response to line "Set Tab Size" from keyboard

 call SetTabSize (FileID, TabSize)