Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

How to append string in TppDBMemo.OnGetMemo ?

edited November 2002 in RAP
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.

Comments

  • edited November 2002
    Hi Raymond,

    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;
  • edited November 2002
    To put text before the the memo text use

    Lines.Insert(0,Text);

    See TStrings help for example.

    --
    Daniel Lemire
  • edited November 2002
    Thank you very much!!!

    Raymond Ng.
This discussion has been closed.