|
TCustomRichViewEdit.InsertTextFromFile, InsertTextFromFileW |
Top Previous Next |
|
The methods load text file FileName and insert its content in the position of caret. InsertTextFromFile inserts text from ANSI text files, InsertTextFromFileW inserts text from Unicode (UTF-16) text files. function InsertTextFromFile(const FileName: String; CodePage: Cardinal=CP_ACP): Boolean; function InsertTextFromFileW(const FileName: String): Boolean; Inserted text has current text and current paragraph style. A file may contain special characters:CR, LF, TAB, FF (#13, #10, #9, #12). #9 characters may be inserted as tabulators, depending on value of SpacesInTab property of the linked RVStyle component. #12 characters add page breaks. All possible line breaks modes (CR, LF, CR+LF, LF+CR) are supported. InsertTextFromFileW supports the Unicode byte order marks characters (if they are present, they must be the first character in file). Methods type:
▪InsertTextFromFile: if the current text style is Unicode, text will be converted to Unicode (conversion is performed using the CodePage parameter, or, of it's equal to CP_ACP, basing on the charset of the current text style). Note that if the current text style is not a Unicode style, CodePage is ignored. ▪InsertTextFromFileW: if the current text style is ANSI, text will be converted to ANSI (conversion is based on the charset of the current text style).
Return value: "Was reading from from the file successful?"
See also methods: See also methods of TRichView: See also properties: See also properties of TRVStyle: See also: |