Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter FiveGeneral Functions (continued)

Get8Word Function

Overview

The Get8Word function retrieves a 8-bit byte or char from a buffer at a specified byte position.

Syntax/Parameters

Syntax

word = Get8Word ( buffer data, int position );

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 read all bytes.

position

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

Return Value

Returns a word comprised of the data read or 0 on failure. Use the GetLastError function to retrieve error information.

Remarks

The Get8Word function allows a script to reach into a buffer, access a specific byte, and read it into an unsigned byte. It is up to the programmer to extend the sign as required. Use the GetLastError, IsError or IsNotError functions to differentiate between a return value of 0 and an error.

Related Functions

Platform Support

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

Legato IDE, Legato Basic