Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?

FLUSH

Description

Writes all the buffers for a sequential I/O file immediately. Normally, sequential I/O uses buffering for input/output operations, and writes are not immediately flushed. It takes the general form:

FLUSH file.variable {THEN statements [ELSE statements] | ELSE statements}

Where:

File variable specifies a file previously opened for sequential processing. If file.variable evaluates to null, the FLUSH statement fails and the program enters the debugger. After the buffer is written to the file, it executes the THEN statements, ignoring the ELSE statements.

If none of the above can be completed, it executes the ELSE statements.

An example of use is as:

OPENSEQ 'TEST-ENV', 'records_2' TO FILE THEN
   PRINT "'TEST-ENV' OPENED FOR SEQUENTIAL PROCESSING"
END ELSE STOP
WEOFSEQ FILE
WRITESEQ 'This is a new entry' ON FILE THEN
    FLUSH FILE THEN
        PRINT "BUFFER FLUSHED"
    END ELSE PRINT "NOT FLUSHED"
    ELSE ABORT

    CLOSESEQ FILE
END


Go back to jBASE BASIC.

Was this article helpful?