Menu

LoadFromFile

Krzysztof Kamil Jacewicz

[ATUlib]: LoadFromFile

Use this function to load file content into a TStringList object. 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 LoadFromFile(const SL: TStringList; const fn: string): Boolean;

Parameters

  • SL - specifies TStringList object to load file content into
  • fn - specifies path to a file to be loaded into TStringList

Result

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

  • the SL param is nil
  • the fn param points to a non-existent file
  • the file specified by the fn param has read permissions that do not allow for read 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.