Forum > RichMemo

[solved] RichMemo - How to safe it into a file?

(1/2) > >>

Nicole:
TRichEdit from Delpi knows "TRichEdit.SaveToFile('myFile');

and .LoadFromFile.

How to do this by Lazarus and RichMemo?

skalogryz:
.LoadRichText
.SaveRichText

and it needs a TFileStream as a parameter

OR there RichMemoUtils unit with
LoadRTFFile and SaveRTFFile functions

Nicole:
thank you for the answer.
Please can you do it one by one for stupid?

if there is a RichMemo1
and a
c:\myFile

How to connect them?

(I tried a lot, but ended up with error messages about strings, files and streams, filestreams and datastreams "no compatibel')

rvk:

--- Quote from: skalogryz on July 11, 2022, 08:46:31 pm ---OR there RichMemoUtils unit with
LoadRTFFile and SaveRTFFile functions

--- End quote ---
Argh. I missed those in the other topic from TS.
I gave there a class helper for TRichMemo.LoadRTFFromFile.


--- Quote from: Nicole on July 11, 2022, 08:59:07 pm ---(I tried a lot, but ended up with error messages about strings, files and streams, filestreams and datastreams "no compatibel')

--- End quote ---
Always show code and error messages.

Did you include RichMemoUtils in the uses and tried RichMemo1.LoadRTFFile()?

Nicole:
yes.

uses

  LazFileUtils,  RichMemoUtils,   VpData; 

================
code

   self.RichMemo_Notizen.LoadRTFFile(Pfad + 'RichMemo.txt');

============
 compiler

   unit_notizen.pas(153,26) Error: identifier idents no member "LoadRTFFile"   


(PS pls explain this to me, because I am not sure, how to do better: 'Argh. I missed those in the other topic from TS.
I gave there a class helper for TRichMemo.LoadRTFFromFile.' start explanaition by: What does TS mean? thx.)

Navigation

[0] Message Index

[#] Next page

Go to full version