[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'LazStringUtils' (#lazutils)

SaveStringToFile

Writes the specified string value to the specified file name.

Declaration

Source position: lazstringutils.pas line 110

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.

Version info

Added in LazUtils version 4.0.

See also

LoadStringFromFile

  

Reads a string with the contents of the specified file name.

TFileStream


Version 4.0 Generated 2025-05-03 Home