Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter FiveGeneral Functions (continued)

PutString Function

Overview

The PutString function puts a string to a buffer at a specified byte position. The string can be 8- or 16-bits wide.

Syntax/Parameters

Syntax

int = PutString ( buffer data, int position, string value | wstring value, [int size] );

Parameters

data

A buffer as bytes, chars, string or a handle to a Data Object. This is referenced on a byte by byte position to write eight bytes to create the 64-bit floating-point.

position

An int specifying a zero-based position in bytes. This should point to the start of the data for the string. If the position plus the size of the data element is outside of the scope of the buffer, a range error will be returned.

value

A string or wstring value to place in the buffer.

size

An optional int as size value for the string in bytes. If omitted, the size is set to the string length of value, adjusted for element size, without the zero byte. Each wstring character counts as two bytes. The value cannot exceed the string length +1 for the zero terminator.

Return Value

Returns an int as ERROR_NONE or a formatted error code on failure.

Remarks

The PutString function allows a script to reach into a buffer and place all or part of a string. By default, the zero terminating byte is not added.

When adding to a single dimension array, the axis depth is adjusted if the placement exceeds the last position. For other types or multiple dimensions, the axis depth is not adjusted. For automatically allocated arrays, the array size is not adjusted using this function.

When added to a Data Object, the object will be expanded to accommodate the string size. The last position of the Data Object is also adjusted if the end position of the string placed exceeds the last position.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic