WriteRaw method: File class
Syntax
WriteRaw(RawBinary)
Description
The WriteRaw method writes the contents of RawBinary to a file. This can be used for writing images, messages, or other types of raw binary data to a file.
Parameters
| Parameter | Description |
|---|---|
|
RawBinary |
Specify the raw binary to be written to the file. |
Returns
None.
Example
The following example writes employee photos (GIF files) from a record to a file.
Local File &FILE;
Local Record &REC;
Local SQL &SQL;
&REC = CreateRecord(Record.EMPL_PHOTO);
&SQL = CreateSQL("%SelectAll(:1)", Record.EMPL_PHOTO);
&FILE = GetFile("C:\temp\EMPL_PHOTO.GIF", "w", "UTF8", %FilePath_Absolute);
While &SQL1.Fetch(&REC)
&FILE.WriteRaw(&REC.EMPLOYEE_PHOTO.Value);
End-While;
&FILE.Close();
Related Topics