GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Five — General Functions (continued)
Overview
The RunLengthEncode function processes a buffer of information by performing a RLE encode.
Syntax/Parameters
Syntax
int = RunLengthEncode ( var in[], var out[], [dword escape] );
Parameters
in
A variable as the source buffer to encode. The variable source be a single-dimension array or a string. See Remarks for details.
out
A variable to receive the decoded data. The variable source be a single-dimension array or a string. See Remarks for details. The variable is not auto allocated and as such must be large enough to receive the result.
escape
An optional dword containing the encoding escape character. The default valuer is 0xEEEEEEEE.
Return Value
Returns an int as the number of returned bytes or zero on failure. Use the GetLastError and GetLastErrorMessage to retrieve a formatted error code and message.
Remarks
Run Length Encoding (RLE) is a simple method to quickly compress data. Repeated values are escaped by the escape parameter. Since the escape value may be used in the data, it will also be escaped in the encoding.
The buffer data types are restricted to char, string, wchar, wstring, byte, short, word, int, and dword. The type will break down to 1, 2 or 4 byte segments and the encoding will be performed on that basis. As such, the source data should be optimized to the structure of the incoming data. For example, a 24-bit bitmap stores data in 32-bit dwords, therefore the best encoding will happen with 4 byte values or a dword array.
The size of the in buffer is determine either as the axis depth or, if a string type, the string size.
The out buffer must be preallocated to the appropriate size or an ERROR_OVERFLOW will occur. In addition to the return value, the axis depth of the output buffer is set to indicate the size of the data.
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.