Hi again list, (sorry Peter)
Here is a sample of some code I am currently working on:
1 if (abs(x-transient^.x)<2) then 2 if (abs(y-transient^.y)<2) then 3 tmp:=tmp+1; 4 if (transient^.x=x) and (transient^.y=y) then
Well, what happens is that everything goes ok for the first test, but whatever the value is for the second one (y-transient^.y), the PC will jump to line 4, never doing 3.
I have tested with gdb:
(gdb) p Y $1 = 30 '\036' (gdb) p Transient.Y $2 = 31 '\037' (gdb) n (gdb) p Tmp $3 = 0 '\000'
where Tmp was previously naught.
Those are declared as byte.
Is it a GPC bug? Is it a Pascal misunderstanding of mine? What the hell is it?
According to Laussy Fabrice:
Hi again list, (sorry Peter)
No problem.
(* To all: Right now, I have plenty run out of time, so I only answer questions I do not need to think about. If I do not answer an email immediately it simply means that the problem is not of that class. ;*)
Here is a sample of some code I am currently working on:
1 if (abs(x-transient^.x)<2) then 2 if (abs(y-transient^.y)<2) then 3 tmp:=tmp+1; 4 if (transient^.x=x) and (transient^.y=y) then
Well, what happens is that everything goes ok for the first test, but whatever the value is for the second one (y-transient^.y), the PC will jump to line 4, never doing 3.
It might be a problem with incorrect debugging information produced by GPC. Please check the value of `tmp' with a `writeln'.
BTW, you checked the value of `x' too, didn't you? ;-)
Subject: I should really update my GPC version!
Correct. :-)
Good luck,
Peter