How to have TROArray<T> in interface file?

delphi
(RJ) #1

In a code-first server the TROArray<T> was added. That makes coding much easier. How can we get the interface file that is generated by ServiceBuilder to have the same? I tried with and without the code first checkbox checked.

This is for generating code for a delphi client from a delphi server.

The server project was recently migrated to code first by using the Delphi IDE wizard.

0 Likes

(EvgenyK) #2

Hi,

you can’t get TROArray<T> type in _Intf file because this type is generated as TROArray descendant for compatibility with old versions of Delphi.

The Code-First attributes can be generated in code if the Code-First Compatibility checkbox is checked. it will allow to use the same _Impl in RODL- and Code-First-based servers w/o modifying code.

0 Likes

(RJ) #3

Could we have the option to generate the file for newer versions of Delphi?

1 Like

(EvgenyK) #4

Hi,

in general, it has no sense because TROArray and TROArray<T> do the same.
Also in _Intf you shouldn’t declare those arrays manually - codegen does it for you.

0 Likes

(RJ) #5

What we want is a base type that has the Items property and the Add method. All codegen arrays would descend from this class.

0 Likes

(EvgenyK) #6

this is impossible with TROArray because these properties depend on his elements type.

0 Likes

(RJ) #7

function ListQuery<TROType; TROArrayType: uROArray.TROArray<TROType>>(const pQuery: String; const pOnResult: TQueryResult<TROType>): TROArrayType;

function TMyClass.ListQuery<TROType, TROArrayType>(const pQuery: String; const pOnResult: TQueryResult<TROType>): TROArrayType;
    begin
       result := TROArrayType.Create;
          while ..... do
            result.Add(TROType.Create);
    end;

This code works on the server. We want to use this same type of code on the client. Is that possible?

0 Likes

(RemObjects) #9

Thanks, logged as bugs://82269

0 Likes

(RemObjects) #10

bugs://82269 got closed with status fixed.

0 Likes