Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter FiveGeneral Functions (continued)

EncodeString Function

Overview

The EncodeString function encodes a source string, Data or Pool Object and returns an encoded string.

Syntax/Parameters

Syntax

string = EncodeString ( string source | handle source, [dword mode], [ind pad] );

Parameters

source

A string or handle containing the data to be encoded. The handle can specify a Data Object or Pool Object. See Remarks for details.

mode

An optional dword specifying operating mode. See Remarks for details. The mode can be ENCODE_BASE32 or ENCODE_BASE64. The default is ENCODE_BASE64.

pad

An optional int containing a padding value to lead each line. The default value is zero. Note that is is not the trailing pad character for Base64.

Return Value

Returns a string containing the encoded data or empty on failure. Use the GetLastError and GetLastErrorMessage to retrieve a formatted error code and message.

Remarks

While EncodeString is meant to process a number of formats, it presently supports Base64.

For Base64, the mode has the following options:

ENCODE_NO_LINE_ENDINGS         Remove Line Endings (solid block)

ENCODE_ENCODE_LINE_ENDINGS     Encode Line Endings (\r)

When encode linings is used, the return token \r must be manually removed or changed to a return code before decoding. Not all decoders accept a solid block of Base64.

Base32 encoding is based on RFC 4648. Base32 encodes to a direct string without formatting.

Related Functions

Platform Support

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

Legato IDE, Legato Basic