GoFiler Legato Script Reference
Legato v 1.5d Application v 5.25a
|
Table of Contents | < < Previous | Next >> |
Chapter Six — File Functions (continued)
Overview
The VariableToFile function writes the contents of a variable directly to a file.
Syntax/Parameters
Syntax
int = VariableToFile ( mixed data, string filename, [int bytes] );
Parameters
data
Any variable type as long as it occupies contiguous memory.
filename
A string containing a destination filename and path. This parameter supports UTF encoding for filenames with Unicode characters.
bytes
An optional int containing the number of bytes to write.
Return Value
Returns an int as ERROR_NONE or a formatted error code on failure. Use the GetLastError function to retrieve error information.
Remarks
The VariableToFile function can be used to perform file output functions such as writing a string as a web page to a file or dumping the contents of a complex array. The function will write directly to a file specified by the filename parameter. Only a single operation is allowed. If the file does not exist, it is created, and, if it exists, it is overwritten. If the value of the bytes parameter is larger than the size of the data parameter, the function will return an error.
The function presently only writes simple variables.
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.