varargs in GPC_(re)
Thu, 13 Mar 1997 23:17:34 -0500
Peter Gerwinski wrote:
>
> > I thought that GPC did not support varargs. In fact, I
> > was hoping that it would support the VAX Pascal syntax for
> > doing so. What is the status of variable arguments for GPC?
>
> It does support `ellipsis' parameters to call functions with varargs
> written in C. We have not (yet!;) implemented a portable mechanism to
> access them.
>
> IMHO, it would be reasonable to implement the VAX Pascal syntax into GPC
> rather than inventing a new method. If you tell me about the VAX Pascal
> syntax for accessing varargs, it will enable me to do this.
[stuff deleted]
> However: Please help me to with VAX Pascal vararg syntax! I don't have
> a VAX, and I don't have the money to buy one, so I need example programs
> with descriptions what they are intended to do, etc. (you know).
>
Unfortunately, it's been about 7 years since I had access to the compiler. However, I saw a VAX
Pascal book in a bookstore and I'm going to pick it up this weekend. The online help I have seen
for VAX Pascal did not go into much detail on syntax.
The VAX approach, as I remember it, used an array of parameters.
The VAX Pascal language had two kinds of arrays: ARRAY and VARYING. The varying kind worked a bit
like Turbo Pascal strings. There was a maximum size and a current length. I think the varargs
mechanism was similar to the VARYING arrays.
You could define strings as:
TYPE
string = VARYING[1..255] of CHAR;
I'll get back to you on this.
> Greetings,
>
> Peter
>
> Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer
> peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201]
> maintainer GNU Pascal - http://home.pages.de/~gnu-pascal/ [970125]
--
Ronald Perrella
perrella@mindspring.com
Roswell, Georgia, USA.
Ronald Perrella (perrella@mindspring.com)
HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada -
Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es