saveTextToFile

saveTextToFile(fileName: String): Integer;

The saveTextToFile method of the JadeTextEdit class saves the text in the text editor to the fully qualified name of the text file specified in the fileName parameter. This file name includes the full path of the JADE application if the file is not located in the default directory. End-of-line sequences in the text buffer are converted to match the platform.

If the file cannot be opened, the saveTextToFile method returns the appropriate exception code rather than raising exceptions to report errors (for example, 5003 - Requested file not found).

If the file write operation was successful, this method returns zero (0). In a Unicode system, the file is written with the kind property of the File object set to Kind_Unicode_UTF8, meaning wide characters (for example, UTF-16 in a Windows environment); otherwise, it is written with the kind value of Kind_ANSI.

You can use this method to determine if the JadeTextEdit support library (that is, the jadedit DLL) is present, by calling it with the fileName parameter set to null (""). If the library is present and it is usable, the saveTextToFile method returns error JTE_FILENAME_EMPTY.