Sign in Join
FPDoc Onlineexperiment

SaveStringToFile function

In unit LazStringUtils

Writes the specified string value to the specified file name.

Declaration

pascal
function SaveStringToFile(const aString: string; 
 const aFileName: string): Boolean

Arguments

aString

String value stored in the routine.

aFileName

File name where the string value is stored.

Function result

Returns True if the string was successfully written to the file.

Description

SaveStringToFile creates a TFileStream instance for the specified file name, and writes the content in AString to the stream. The stream is created with fmCreate mode. The Write method in the file stream is used to store the value in AString. The return value is True if the string value was successfully written to the stream instance.

Use LoadStringFromFile to read a string value from a file.

Added in LazUtils version 4.0.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.