open_buffer

This function is always used in combination with the put_buffer_in_document function (see put_buffer_in_document). These functions together save parts of a result document to a location on the file system while the saved part is also written to the result document, as opposed to the put_in_document function (for more information on the put_in_document function, see put_in_document). This function can only be used in KCM Core.

The function open_buffer indicates the position in a Template script from where the result text is saved. The marker is placed in the result document wherever this function is called.

 open_buffer ( marker_name )

The function yields a result type BOOL: TRUE if the marker is successfully placed, FALSE if it failed to set the marker or if the function is not supported.

This function has no effect on the AiaDocXML and HTML output.

The function open_buffer has one parameter:

  • marker_name, type TEXT. The function places a marker with this name at the position in a Template script where it is called. The markers are case-sensitive.

If creation of the document is delayed, it may later cause a fatal error.

The function open_buffer fails if the name of the buffer is invalid (empty).

You can call this function repeatedly throughout a Template script and store several fragments of the result text if you use a unique marker_name.

If the function open_buffer is called more than once with the same value for the parameter, only the last position of the marker is saved.

An example is provided here.

 BOOL ok := open_buffer( "example" )

The marker example is placed in the text where this line is in the Template script. The success of this action is stored in ok.