Skip to main content

NOBUF

Turns off buffering for sequential file I/O.

Synopsis

NOBUF filevar [THEN statements] [ELSE statements]

Arguments

filevar A file variable name used to refer to a MultiValue sequential I/O file. This filevar is supplied by the OPENSEQ statement.

Description

By default, sequential file I/O is performed using I/O buffering. This buffer is automatically assigned as part of the OPENSEQ operation. I/O buffering significantly improves overall performance, but means that write operations are not immediately applied to the sequential file. The NOBUF statement disables the I/O buffer for an open MultiValue sequential file. That is, all I/O operations are immediately executed on the sequential file.

NOBUF takes the file identifier filevar, defined by the OPENSEQ statement. Thus, NOBUF can only be issued after a sequential file has been opened with I/O buffering.

You can optionally specify a THEN clause, an ELSE clause, or both a THEN and an ELSE clause. If the file buffer is successfully disabled (the specified filevar exists), the THEN clause is executed. If the buffer disable fails (usually because the specified filevar does not exist), the ELSE clause is executed. The statements argument can be the NULL keyword, a single statement, or a block of statements terminated by the END keyword. A block of statements has specific line break requirements: each statement must be on its own line and cannot follow a THEN, ELSE, or END keyword on that line.

Caché MVBasic also provides a FLUSH statement, which immediately writes the current contents of the I/O buffer to the sequential file.

See Also

FeedbackOpens in a new tab