Russell Whitaker wrote:
On Wed, 3 Mar 2004, Frank Heckenbach wrote:
[..]
program testMT; uses GPC; const big = 10000000; TimeFormat = ' %Q'; var t1, t2, i, j : medCard; CurrentTime : TimeStamp;
begin GetTimeStamp (CurrentTime); WriteStr(FormatTime(CurrentTime, TimeFormat), t1); { line 17 } { WRONG } for i := 1 to big do j := randInt; GetTimeStamp (CurrentTime); WriteStr(FormatTime(CurrentTime, TimeFormat), t2); Writeln('Elapsed time: ', (t2 - t1):1); end.
If I change the first writestr like so:
var s : string[30]; ... s := FormatTime(CurrentTime, TimeFormat); writestr( s, t1 ); ...
Two of the original errors went away:
Yes, but it doesn't do what was intended.
frank.pas: In main program: frank.pas:14: error: undeclared identifier `randInt' (first use in this routine) frank.pas:14: error: (Each undeclared identifier is reported only once frank.pas:14: error: for each routine it appears in.) frank.pas:16: error: reference expected, value given frank.pas:16: error: reference expected, value given
Is line 16 a bug?
No, it's correct. The first parameter of `WriteStr' cannot be a value because it's written to.
And where would I find 'randInt' ?
I suppose it's in the unit the OP was developing, so you'd have to take it out here.
Emil Jerabek wrote:
Do I understand it correctly that the "reference expected etc." messages are OK, and the only question is about the "tree check" failure?
Yes.
If so, the error seems to be already fixed in gpc 20030830.
Thanks for checking.
Frank