[fpc-pascal]Minimum size of parameters

Jonas Maebe jonas at zeus.rug.ac.be
Thu Dec 6 17:07:26 CET 2001


On donderdag, december 6, 2001, at 04:47 , Aitor Santamaria Merino wrote:

> If the answer to the previous was NO, then do you have another idea to 
> solve my initial problem, execute this:
> RECORD
>      Pt: PointerToCertainProcedure;
>      Sz: SizeInBytesOfProcedureArgs;
>      Arg: PointerToARecordContainingArgs;
> END;

Pascal (Delphi-style pascal) has a generic solution for this. It's 
called an "array of const". You use it like this:

***
procedure p(args: array of const);
var
   i: longint;
begin
   for i := low(args) to high(args) do
     case args[i].vtype of
       vtInteger:
         writeln(args[i].vInteger);
       ...
     end;
end;

begin
   p(["string",'c',1354]);
end.
***

I suppose this is all explained in the reference manual, though I'm not 
sure.


Jonas





More information about the fpc-pascal mailing list