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

Using TStringList.Duplicate - compile error

edited January 2005 in RAP
Hi,

Trying to compile following code in rap :

procedure GlobalOnCreate;
begin
Ordrer := TStringList.Create;
ordrer.Sorted := True;
Ordrer.Duplicates := dupIgnore;
end;

but are getting the following error :

Error:GlobalOnCreate Line 5:Expected to find : '(' or '[' , but found
'Duplicates' instead.

The error text is translated from norwegian back to english so it may not
apear exactly alike in english, but the message should be understandable I
believe.

Why does this error appear? it should be valid code.

By the way I am using RB Enterprise 7.04

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Comments

  • edited January 2005

    The RAP RTTI system does not know about the TDuplicates enum type. To
    register the enum type, add some Delphi code to the Initialization section
    of one of your units.

    uses
    Classes, ppEnum;

    initialization
    raRegisterEnum('TDuplicates', TypeInfo(TDuplicates));


    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2005
    This diden't work... are you sure the "Duplicates" property is made
    "Visible" in RAP?

    On Mon, 10 Jan 2005 10:36:37 -0700, Nard Moseley (Digital Metaphors)
  • edited January 2005

    I researched this and you are correct, the Rap for RTTI for TStringList does
    not include the Duplicates or CaseSensitive properties. So both the
    TStringListRTTI and the Enum need to be updated.

    I have created a patch for RB 9.01, you can email
    support@digital-metaphors.com and request the patch.



    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.