SETEOF statement

Purpose:

SETEOF extends or truncates the size of a file to the current position of the file pointer.

Syntax:

SETEOF hFile AS FILE

Parameters:

  • Data type: FILE
    hFile The handle of a file.

Example:

DIM A$
OPEN "Temp.dat" FOR BINARY NEW AS FP1
A$ = SPACE$(80)
PUT$ FP1, A$, LEN(A$)   ' File is now 80 bytes 
SEEK FP1, 40            ' Move to the 40th byte 
SETEOF FP1               ' File is now 40 bytes 
CLOSE  FP1