Board index » delphi » Passing indefinite number of parameters

Passing indefinite number of parameters

Is there any way to pass an indefinite number of parameters to a
procedure or function?

 

Re:Passing indefinite number of parameters


In article <319337B0.2...@hcc-uky.campus.mci.net>,
   Kelly <kash...@hcc-uky.campus.mci.net> wrote:

Quote
>Is there any way to pass an indefinite number of parameters to a
>procedure or function?

Yes, let the 'parameter' point to a linked list of pointers.

Something like:

type  Parm = array[0..1] of pointer;
 . . . . .
Function multiarg(x:Parm):sometype;
type s:Parm;
begin
s := x;
repeat
 with s[0]^ do
 . . . . .
 s := s[1];
until s = nil;
 . . . .
end.

regards Sven

Re:Passing indefinite number of parameters


Quote
Kelly (kash...@hcc-uky.campus.mci.net) wrote:

: Is there any way to pass an indefinite number of parameters to a
: procedure or function?

there is, if you put the indefinate number of parameters in an array. you
have to delcare the array in the procedure/function like

ThisArray : array of ______;

but for some reason string[##] doesn't work. you just have to declare it
string

i hope this helps.
victor dods

Other Threads