[fpc-pascal] Pass array of record as parameter

Everton Vieira tonvieira at gmail.com
Thu Feb 9 19:43:19 CET 2012


That`s a nice idea.

Em 09/02/2012, às 16:21, Ludo Brands escreveu:

>  
> 
> 
> Thanks, but that is not my expected answer, my ask about "dynamic array of record" and without define a variable to pass it by params, for example i can pass the params for array of string like this
> 
> func2(['t1', 't1']); this work, but i want to extend the params info?
> 
> You can use a small helper function like this:
>  
>  
> type
>   TInfo=record
>     s: string;
>     i: integer;
>   end;
>   function makeinfo(s:string;i:integer):TInfo;
>   begin
>     result.s:=s;
>     result.i:=i;
>   end;
> ...
>  
>   func1([makeinfo('test1', 1), makeinfo('test2', 2)]);
>  
>  Ludo
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120209/fa714f13/attachment.html>


More information about the fpc-pascal mailing list