[fpc-pascal] How to declare function with untyped array parameter

LacaK lacak at zoznam.sk
Thu May 26 10:37:49 CEST 2016


>> is there way how to declare function, which will accept as parameter any
>> array type ?
>> (this parameter I need forward to System.Length() only )
> Generally one uses TArray<T> as parametertype. in such cases. One can take
> the length of a generic array.
Hm,
I do not understand.

I need something like:

function GetLength(const A): integer; inline;
begin
   Result := System.Length(A); // of course here I get "Type mismatch"
end;

Regular function, which I will call from generic object method as far as 
inside generic object method I can not use System.Length()



More information about the fpc-pascal mailing list