GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Five — General Functions (continued)
Overview
The Get8String function retrieves an 8-bit string from a buffer at a specified byte position for a specified length.
Syntax/Parameters
Syntax
string = Get8String ( buffer data, int position, [int characters] );
Parameters
data
A buffer as bytes, chars, string, any variable type or 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 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.
characters
An optional int specifying the number of characters to retrieve. If set to -1, the function will read until a zero (/0) terminator is encountered. If omitted, the value defaults to the total buffer size less the specified position.
Return Value
Returns a string comprised of the data read or empty on failure. Use the GetLastError function to retrieve error information.
When copying to the zero terminator (-1 for characters parameter), the last error will contain the number of characters copied without the zero terminator.
Remarks
The Get8String function allows a script to reach into a buffer and access a specific set of characters that presumably make up a string.
If the source information contains a zero byte, it will terminate the returned string at that position. Should the specified area not contain an ending zero byte, one will automatically be added. Using a size of -1 allows zero-terminated string to be copied from the buffer without knowing the length of the source string.
When the source data is a string or wstring type, the allowed data range is the allocated string size, not the string length (the character count to the terminating zero).
Use the GetLastError, IsError or IsNotError functions to differentiate between a return value of an empty string and an error.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE, Legato Basic
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.