Page 1 of 1

Odd Compiler Error

Posted: 28 May 2006, 11:41 AM
by pdubinsky
I had a segment of code the subtracted an offset from a variable:

Code: Select all

330		Ax = (PotPos * 5.0) - 2.5
331		Ax = Ax - Ax0
332
333		OutS = "-"
334		if Ax < 0.0 then
335			OutS = "+"
336		end if
337
338		Ax = &#40;Fix&#40;Abs&#40;Ax * 100.0&#41;&#41; / 100.0&#41;
which compiled fine. But during testing I commented out the offset:

Code: Select all

330		Ax = &#40;PotPos * 5.0&#41; - 2.5
331		Ax = Ax '- AxO
332
333		OutS = "-"
334		if Ax < 0.0 then
335			OutS = "+"
336		end if
337
338		Ax = &#40;Fix&#40;Abs&#40;Ax * 100.0&#41;&#41; / 100.0&#41;
which generated the following errors:

BasicZX_PW.bas:334: Internal Error: no means to generate code for expression
BasicZX_PW.bas:338: Internal Error: no means to generate code for expression

Obviously, there is no need for the Ax = Ax statement but it is an odd error.

Paul

Posted: 29 May 2006, 9:09 AM
by dkinzer
The cause of the error has been identified and a solution has been devised.

Thanks for the detailed report.