Hi,

Code:
if (poscnt<azimval) or (azimval-poscnt >= 1800) then
I just would had written ...

Code:
if (poscnt<azimval) or ((azimval-poscnt) >= 1800) then
to be sure of what happens ... ( might be overkill ... but ... )

Alain