contents.gifprev1.gifnext1.gif

CREATE_BUFFER

Description:

CREATE_BUFFER creates an new empty text buffer data structure. The buffer name is based on the first parameter to CREATE_BUFFER and must be unique. Buffer names in nu/TPU are case-sensitive, this is a difference from VAX/TPU. An optional second parameter specifies a file to read into the buffer. An optional third parameter sets some values of the new buffer to match an existing one. Using this optional third parameter, the following values will be copied. All of the following values can also be altered with the SET builtin.

tpu90000.gif Direction

tpu90000.gif End of buffer text

tpu90000.gif Insert/overstrike mode

tpu90000.gif Key-maps

tpu90000.gif Margin actions

tpu90000.gif Maximum number of lines

tpu90000.gif Modify status

tpu90000.gif NO_WRITE

tpu90000.gif Right and left margins

tpu90000.gif Tab stops

Syntax:

buffer := CREATE_BUFFER ( BUFFER_NAME )

buffer := CREATE_BUFFER ( BUFFER_NAME, FILE_NAME )

buffer := CREATE_BUFFER ( BUFFER_NAME, FILE_NAME, DEFAULTS_BUFFER )

Examples:

The following creates a new buffer variable and assigns it to the variable BUFFER$RETURN, labels the buffer main, and reads the file file.txt into the buffer.

BUFFER$RETURN := CREATE_BUFFER ("main", " ");

The following creates a new buffer, labels the buffer main, reads the file FILE.TXT, and copies some values from the existing buffer OLD$BUFFER.

BUFFER$RETURN := CREATE_BUFFER ("main", "FILE.TXT", OLD$BUFFER );

Errors:

TPU$_DUPBUFNAME Buffer name already exists.

TPU$_OPENIN Could not open READ file.

Related Builtins:

DELETE

READ_FILE

SET