[comp.lang.pascal] Variable Parameter Passing

azarian@hpcc01.HP.COM (Randy Azarian) (10/10/90)

Does standard Pascal provide for a variable number of parameters to be
passed to a function or procedure?

In other words, when I say WRITELN I can include any number of parameters
(additionally, of any data type), to the WRITELN procedure.  Is there a way
to write my own procedures to accept any number of parameters of any data
type?

I am presently writing in Microsoft Pascal 4.0, but I am really curious as
to whether this is provided for in the Pascal Standard.

Thanks ...

reagan@hiyall.enet.dec.com (John R. Reagan) (10/10/90)

In article <1170001@hpcc01.HP.COM>, azarian@hpcc01.HP.COM (Randy Azarian) writes...
>Does standard Pascal provide for a variable number of parameters to be
>passed to a function or procedure?
> 
>In other words, when I say WRITELN I can include any number of parameters
>(additionally, of any data type), to the WRITELN procedure.  Is there a way
>to write my own procedures to accept any number of parameters of any data
>type?
> 
>I am presently writing in Microsoft Pascal 4.0, but I am really curious as
>to whether this is provided for in the Pascal Standard.
> 
>Thanks ...

No.  Neither unextended Pascal (the 1983 standard) or Extended Pascal
provide a mechanism for variable number of arguments to a routine.

That functionality is on the committee's list of possible work items,
but isn't one of the currently active items (which are object-oriented
features and exception handling).  Any committee member (the committee
is open to the public, by the way) can "champion" a feature.  You're
welcome to come to the next meeting (in Orange County, CA) and take
up a shield and sword...

---
John Reagan
Digital Equipment Corporation
reagan@hiyall.enet.dec.com
Disclaimer:  The opinions and statements expressed by me are not
             necessarily those of Digital Equipment Corporation.
---