write ('There are ', items:1, ' items')
Or does this "clipping" only apply to strings? Clipping only applies to strings. I see, fine.
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.') :) Err... well, I meant 'Phil' was the value of a string variable. I thought this would be clear.
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))". Ok, then, if I got this right, you have to do write(num_var:1) and write(string_var) for output without spaces, whereas write(num_var) and write(string_var:1) both don't work this way.
This seems a bit inconsistent and confusing to me. I see that your programs rely on this way, but my programs rely on BP's way, and I don't think there's anything worse with BP's way than the standard's way. So, obviously, gpc needs to support both ways.
"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)". This explains to me why this clipping is needed in standard Pascal. However, I really don't want to use hand-made strings in my programs, I really could stand a little more comfort... :-) -- Frank Heckenbach, Erlangen, Germany heckenb@mi.uni-erlangen.de Turbo Pascal: http://www.mi.uni-erlangen.de/~heckenb/programs.htm Internet links: http://www.mi.uni-erlangen.de/~heckenb/links.htm
participants (5)
-
Frank Heckenbach -
Jan-Jaap van der Heijden -
Nils Bokermann -
Phil Nelson -
Sven Engelhardt