Re: Untyped variables of a function

Shadow <[email protected]> Thu, 02 Sep 2021 08:12:53 -0300
Newsgroups alt.comp.lang.pascal
Organization A noiseless patient Shadow
Message-ID <[email protected]>
On Thu, 2 Sep 2021 08:05:04 +0200, "F. W." <[email protected]> wrote:

>Am 02.09.2021 um 00:53 schrieb Shadow:
>
>>> Pascal has strong types. Is it anyhow possible to define a 
>>> parameter of a function or procedure that allows passing variables 
>>> of any type?
>
>> I discovered that to get help here you have to describe exactly what 
>> you are trying to do. No, the group is not dead. What sort of 
>> function would have to accept any kind of variable? []'s
>
>I wanted to imitate the printf-function of c in Pascal.
>
>void printf (char *format, ...)
>
>That was one of the advantages of Pascal against Modula-2. There was no
>flexible WRITE/WRITELN-Procedure in M2.
>
>VAR a: INTEGER; b: CHAR; c: STRING;
>
>Modula-2:
>
>IO.WrStr ('Hello');
>IO.WrInt (a);
>IO.WrStr (b);
>IO.WrStr (c);
>
>Pascal:
>
>WRITELN ('Hello', a, b, c);
>
>FW

	Convert one type to another when printing.

	IntToStr, for example.
	[]'s
-- 
Don't be evil - Google 2004
We have a new policy  - Google 2012
Google Fuchsia - 2021