[Overview][Resource strings][Constants][Types][Classes][Index] | Reference for unit 'resource' (#fcl-res)

# TResources.WriteToFile

Writes the contents of the object to a file

## Declaration

Source position: resource.pp line 275

`public procedure TResources.WriteToFile(`
`aFileName: string`
`); overload; procedure TResources.WriteToFile(`
`aFileName: string;`
`aWriter: TAbstractResourceWriter`
`); overload;`

## Arguments

`aFileName` |  | The name of the file to write to

## Arguments

`aFileName` |  | The name of the file to write to
`aWriter` |  | The resource writer to use to write to the file

## Description

This method writes the contents of the object to a file whose name is passed as parameter.

If a writer is specified, that writer is used. Otherwise, the first registered writer matching the file name extension is used.

## Errors

If no writer is passed and no suitable writer is found, an EResourceWriterNotFoundException exception is raised.

## See also

TAbstractResourceWriter |  | Base abstract resource writer class
TResources.WriteToStream |  | Writes the contents of the object to a stream