Menu

SaveToFile

Krzysztof Kamil Jacewicz

[ATUlib]: SaveToFile

Use this function to save the content of TStringList object into a file. It will not raise any exception at runtime, instead its return value will let you evaluate whether or not the operation was successful.

Function header

Function SaveToFile(const SL: TStringList; const fn: string): Boolean;

Parameters

  • SL - specifies TStringList object which content is supposed to be saved to a file
  • fn - specifies path to a file to save the content of TStringList into

Result

Returns true if the content of TStringList object is successfully saved into a file specified. Otherwise it returns false. Most possible reasons for the function to fail (return false) are:

  • the SL param is nil
  • the fn param does not specify a valid file path
  • the file specified by the fn param has permissions that do not allow for write operation

Related

Wiki: ATUlib

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.