Hello,
I use the method "InsertStringTag" to insert fields. It works great.
Is there a method to insert strings with RC (#13#10) ?
Thanks
Yann
InsertStringTag with RC
-
- Site Admin
- Posts: 17565
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17565
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
No, sorry. Because it's rarely needed.
You can use this procedure (assuming that rvoTagsArePChars in rve.Options):
If you use TRichView version older than 1.9.22, remove calls to BeginUpdate and EndUpdate.
---
Update 2011-Oct-22: changed for compatibility with TRichView 13.3+
You can use this procedure (assuming that rvoTagsArePChars in rve.Options):
Code: Select all
procedure InsertTextTag(rve: TCustomRichViewEdit; const Text, Tag: String);
var SL: TStringList;
i: Integer;
begin
SL := TStringList.Create;
SL.Text := Text;
rve.BeginUpdate;
for i := 0 to SL.ItemCount-1 do
rve.InsertStringTag(SL[i], Tag);
// for older versions of TRichView: rve.InsertStringTag(SL[i], Integer(StrNew(PChar(Tag))));
rve.EndUpdate;
SL.Free;
end;
---
Update 2011-Oct-22: changed for compatibility with TRichView 13.3+