Write - DfBaseRichEdit
Writes RTF stream content of control to file
Type: Procedure
Parameters
| Parameter | Type | Description |
|---|---|---|
| sFileName | String | The name (and path to) of the RTF document to write to |
Syntax
Procedure Write String sFileName
Call Example
Send Write sFileName
Description
Writes the entire content of control as an RTF stream to file specified by sFileName.
Sample
This sample writes the entire content of control oRichEdit1 to a document named MyDocument.rtf.
Procedure ReadFile
string sFileName
move "MyDocument.rtf" to sFileName
send Write of oRichEdit1 sFileName
End_Procedure // ReadFile
Sample
This sample allows the user to select a document using an SaveAsDialog control, and then writes the entire content of control oRichEdit1 to the document name the user has specified in the SaveAsDialog. This sample assumes that a SaveAsDialog control named oSaveAsDialog1 exists in your code.
Procedure ReadFile
string sFileName
set Filter_String of oSaveAsDialog1 to 'RTF Documents (*.rtf)|*.rtf|All Files (*.*)|*.*'
get Show_Dialog of oSaveAsDialog1 To bOk
if (bOk = True) begin
get File_Name of oSaveAsDialog1 to sFileName
send Write of oRichEdit1 sFileName
end
End_Procedure // ReadFile