New Alpha_(re)

Thu, 3 Apr 1997 05:12:53 -0800 (PST)



>BTW: Phil, how do you output a number without spaces (or, let's say
>with exactly one space) in standard Pascal, e.g. to write the simple line
>N"There are 7 items" (with 7 being the value of a variable)?
>With no (or a big) format specifier, there would be more spaces than
>wanted, with a small format specifer, large numbers would be cut.

write ('There are ', items:1, ' items')

>Or does this "clipping" only apply to strings?
Clipping only applies to strings.

>But then again, how would you do "You name is Phil."?
>Do you have to "write(s:Length(s))" or such?

write ('You name is Phil.')    :)

In standard Pascal there are no string schema types like extended Pascal,
but in extended Pascal "write(s)" is identical to "write(s:length(s))".

"Strings" in standard Pascal are typically an "array [1 .. n] of char".
The programmer then needs to keep track of how many of the n characters
are valid.  Then the write statement would look like "write (s:sizeofs)".

-- 
Phil Nelson                       NetBSD: http://www.netbsd.org
e-mail: phil@cs.wwu.edu           LPF: http://www.lpf.org
http://www.cs.wwu.edu/~phil       !gifs: http://www.lpf.org/Patent/Gif/Gif.html


Phil Nelson (phil@cs.wwu.edu)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es