Odd Compiler Error

Questions and discussion about the ZBasic IDE.
Post Reply
pdubinsky
Posts: 70
Joined: 24 November 2005, 18:19 PM
Location: South Carolina
Contact:

Odd Compiler Error

Post 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
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

The cause of the error has been identified and a solution has been devised.

Thanks for the detailed report.
- Don Kinzer
Post Reply