Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter SixFile Functions (continued)

MappedTextSave Function

Overview

The MappedTextSave function saves a Mapped Text Object to its associated file or to a specified filename.

Syntax/Parameters

Syntax

int = MappedTextSave ( handle hObject, [string filename], [dword flags] );

Parameters

hObject

A handle to a Mapped Text or Edit Object.

filename

An optional string specifying a location to save the data. If not provided, the current filename is employed. To supply a default parameter, use an empty string.

flags

An optional dword containing flags to adjust the save process. See Remarks below for a definition of flags. If omitted, the values follow the application settings as defined in the preferences.

Return Value

Returns an int as ERROR_NONE or a formatted error code on failure.

Remarks

The edit changes flag and modified conditions are reset once the Mapped Text Object is saved.

  Definition   Bitwise   Description
  MSF_BAK_FILE_LIMIT   0x0000000F   Limit of Journal Files
  MSF_BAK_FILE_AS_JOURNAL   0x00000100   Perform Backup as Journal Files (name (01).bak)
  MSF_BAK_FILE_HIDDEN   0x00000200   Make Backup Files Hidden
  MSF_NO_BAK_FILE   0x00000400   No Backup File
  MSF_NO_NEWLINES   0x00010000   No 0x0A New Line Codes
  MSF_WRITE_ATTRIBUTES   0x00020000   Write Attributes to File
  MSF_OVERRIDE_READ_ONLY   0x00040000   Override Read-Only Setting
  MSF_NO_FILE_SAVE_NOTIFY   0x00100000   Do Not Notify Application of Change (this only applies to objects associated with one or more windows)

 

By default, save follows simple backup rules so the save function will create a ‘.bak’ file for the associated file. When specifying a filename, backup files are not created. When creating the object using CreateMappedTextFile, backup files will not be created on the first save for the handle.

Line endings are marked as “/r/n”. Setting the MSF_NO_NEWLINES flag results in “/r” line endings. If the application is running in GUI mode, the frame is notified of a file change unless the MSF_NO_FILE_SAVE_NOTIFY flag is set. This allows for the updating tabs and other information.

Related Functions

Platform Support

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

Legato IDE, Legato Basic