How to append string in TppDBMemo.OnGetMemo ?
Hi,
I want to append a string 'Test:' before the content in TppDBMemo, so I
implement the OnGetMemo event in TppDBMemo. E.g.
Procedure DBMemo1OnGetMemo(Lines: TStrings);
Begin
Lines[0] := 'Test:'+Lines[0];
End;
However, when preview the report, a error exist "Could not run program:
DBMemo1OnGetMemo". What's wrong of my code?
Thanks,
Raymond Ng.
I want to append a string 'Test:' before the content in TppDBMemo, so I
implement the OnGetMemo event in TppDBMemo. E.g.
Procedure DBMemo1OnGetMemo(Lines: TStrings);
Begin
Lines[0] := 'Test:'+Lines[0];
End;
However, when preview the report, a error exist "Could not run program:
DBMemo1OnGetMemo". What's wrong of my code?
Thanks,
Raymond Ng.
This discussion has been closed.
Comments
you are using an illegal index, Lines.Count is 0. I would use the following code:
Lines.Add('Test');
Lines.Add(plMyPipeline['myMemoFieldName']);
regards,
Chris Ueberall;
Lines.Insert(0,Text);
See TStrings help for example.
--
Daniel Lemire
Raymond Ng.