BBjTriggerData::getWriteBuffer

Description

In BBj 6.00 and higher, this method returns the record passed into a call to WRITE RECORD in a BBj program or the record being written to the data file in an SQL INSERT or UPDATE statement. This is the raw data written to disk so a string template should typically be used to parse the record into usable fields if processing of the information is required.

Syntax

Return Value

Method

byte[]

getWriteBuffer()

Parameters

None.

Return Value

The write buffer that will be written.

Remarks

Methods that return byte[] can usually be treated as if they returned string, because BBj automatically handles the conversion. However, when that byte[] value is directly assigned to an object variable or passed to a Java method, BBj skips the conversion and the raw internal byte[] format is used. You can always use the STR() function to explicitly convert the byte[] value to a string.

Example

rem 'Get the Trigger object from the BBj File System

td! = BBjAPI().getFileSystem().getTriggerData()

rem 'String template to parse the record
DIM writeBuffer$:"COL1:C(10),COL2:I(4),COL3:N(4)"

rem 'Get the IDString
writeBuffer$ = td!.getWriteBuffer()

rem 'Get the value for one of the fields
myVal$ = writeBuffer.col1$
myNumVal = writeBuffer.col3

See Also

BBjAPI

BBjTriggerData

ObjectVariables

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.