Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter SixFile Functions (continued)

StringToFile Function

Overview

The StringToFile function writes the contents of a string to a file.

Syntax/Parameters

Syntax

int = StringToFile ( string data | wstring data, string name );

Parameters

data

A string or wstring to write to the file.

name

A string containing a qualified file name and path. This parameter supports UTF encoding for filenames with Unicode characters.

Return Value

Returns an int as ERROR_NONE a formatted error code. Use the GetLastError function to retrieve error information.

Remarks

This function differs from the VariableToFile function in that it is specifically designed to write a zero-terminated string without writing the zero byte/word. 

If the source is a wstring, the content is treat as Unicode and written in little-endian (least significant byte first) with the appropriate header.

If the file exists, it is overwritten without warning.

The contents of the string are not altered in any way during the write process (e.g., adjusting line endings).

Related Functions

Platform Support

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

Legato IDE, Legato Basic