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

Passing object as parameters in RAP

edited March 2007 in RAP
Hi,

I did some tests with passing objects as parameters in RAP. This was done in
relation with some issues from the post 'Interactive reports' of 11-03-2007'

I created the following global procedure in the RAP module:

procedure AddProductInfo(Lines: TStrings);
begin
Lines.Add( 'Materiaal' );
end;

called it from a DBMemo.OnGetMemo()

procedure DBMemo1OnGetMemo(Lines: TStrings);
begin
Lines.Clear;
AddProductInfo( Lines );
end;

No compile errors but at runtime the Lines object is not filled with the
'Materiaal' string.
If I change the eventhandler into:

procedure DBMemo1OnGetMemo(Lines: TStrings);
begin
Lines.Clear;
AddProductInfo( TStrings(Lines) );
end;

everything works as expected.
It looks the same issue as is the case when passing objects to pass-thru
functions.

Hope this info helps.

Regards,
Jeroen R?ttink

Comments

  • edited March 2007
    Hi Jeroen,

    Typecasting in RAP is very limited and in some cases very difficult to work
    with. We are constantly working to improve the way they are handled but due
    to some possible early design flaws, it is an ongoing struggle. Thanks
    again for the information, it is very helpful and I'm glad you got it
    working.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.