Stark
2010-03-27 20:14:25 UTC
I am retrieving text form a file .rtf. I am using two different expressions
in two different path in my program. These are the statements:
1 - MemoGen.Lines.LoadFromFile('memo.rtf'); // loading the text content
directly into MemoGen which is a TRichEdit
//
This is OK !
2 - aMemo.LoadFromFile('memo.rtf'); // loading the text content into
aMemo which is a TStringList
MemoGen.Lines.Text:= aMemo.Text; // and then into the richEdit. !!
HERE I GET THE ERROR !!!
At runtime, going step by step, I can see that the string which is loaded
directly into the RichEdit and the one loaded into the StringList come with
a different format.
The first starts with: #$D#$A' ......... (dots are the original
string Text)
The second starts with: {\rtf\ansi------------------------}--#SD#$A'\par
......text.........
The error I get states: "raised exception class EOutOfResources with message
'RichEdit line insertion error'"
The reason I go through the TStringList is that I created an object where
the text of the file memo.rtf is one of the properties from which a RichEdit
may be loaded...
I hope I've been clear enough. The question is: is there something I can do
? Am i making a mistake or should I change solution or what ?
in two different path in my program. These are the statements:
1 - MemoGen.Lines.LoadFromFile('memo.rtf'); // loading the text content
directly into MemoGen which is a TRichEdit
//
This is OK !
2 - aMemo.LoadFromFile('memo.rtf'); // loading the text content into
aMemo which is a TStringList
MemoGen.Lines.Text:= aMemo.Text; // and then into the richEdit. !!
HERE I GET THE ERROR !!!
At runtime, going step by step, I can see that the string which is loaded
directly into the RichEdit and the one loaded into the StringList come with
a different format.
The first starts with: #$D#$A' ......... (dots are the original
string Text)
The second starts with: {\rtf\ansi------------------------}--#SD#$A'\par
......text.........
The error I get states: "raised exception class EOutOfResources with message
'RichEdit line insertion error'"
The reason I go through the TStringList is that I created an object where
the text of the file memo.rtf is one of the properties from which a RichEdit
may be loaded...
I hope I've been clear enough. The question is: is there something I can do
? Am i making a mistake or should I change solution or what ?