On Fri, 21 Feb 2003, Frank Heckenbach wrote:
Russell Whitaker wrote:
On Tue, 11 Feb 2003, Frank Heckenbach wrote:
Russell Whitaker wrote:
minwidth for strings in writeln is broken:
program hello; begin writeln('hello':30, ' ':30, 'world'); end.
The output should be 25 spaces in front of hello and 30 spaces between hello and world.
That's what I get!?
Used gcc-3.2.2 so recompiled gpc with gcc-2.95.3
I now tried with gcc-3.2.2, and it also works.
What did you get actually, did you use any options, etc. ...?
How to get egg on one's face:
Start with this line of code written 3 years ago:
writeln( LST, px[3], Title:35 + length(Title)/2, '':35 - length(Title)/2, 'line ', index:4 );
Compiled and ran ok. Recompliled with every new gpc release until this last one, which also used a new gcc. So to make finding out why, copied hello.pas to nhello.pas:
cp hello.pas nhello.pas
Edited nhello.pas with my trusty editor to the code above, and compiled it and ran it:
gpc -o hello hello.pas
By golly, it doesn't work! So recompiled gpc with gcc-2.95.3 and:
gpc -o hello nhello.pas
By golly, now it works!
Making a long story short, the original problem was integer / integer is a real and minwidth no longer accepts a real. Fixed problem: changed "/" to "div", and went back to using latest alpha with gcc-3.2.2
Russ