Internal error

Discussion specific to the DIP and TQFP packaged ZX devices like the ZX-40, ZX-44, ZX-32 and ZX-328 series. The differences between these devices is primarily the packaging and pinout so most issues will apply to all devices.
Post Reply
bodir
Posts: 3
Joined: 04 September 2006, 18:55 PM

Internal error

Post by bodir »

I'm getting this Internal error.

>"C:\Program Files\ZBasic\zbasic.exe" --directory="C:\Program Files\ZBasic\MyZBasic\I2C-1/" --project="I2C_1.pjt"
Internal error: variable.cpp(1677), Rev 674: invalid type for increment, "ds1307_4.bas" line 104
>Exit code: 1


Here's the code that produces it.

'=======================================================================================
Sub Scheduler()
Dim count_1 As Single 'This is line 104
Dim count_2 As Single
Dim Second As Single

Second = 50.0

Do
count_1 = count_1 + 1.0
count_2 = count_2 + 1.0


if (count_1 = Second) then
Call Print()
count_1 = 0.0
End If

if (count_2 = Second * 5.0) Then
count_2 = 0.0
End If


Call Sleep(0.02) 'in this task 50 times a second.

Loop


End Sub
'=======================================================================================
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

Thanks for letting us know. We have located the source of the problem and fixed it internally. In the mean time, you can work around the problem like this:

Code: Select all

Dim float1 as Single

Sub Main()
  float1 = 1.0
End Sub

Sub Scheduler() 
  Dim count_1 As Single
  ...
  Do 
    count_1 = count_1 + float1
    ....
  Loop
End Sub
This works because the compiler doesn't know the value of float1 where it is added to count_1. This workaround is not effective, however, within Main() since the compiler knows the value of float1 and will attempt to generate the increment code (which it shouldn't do).

We should be able to get a corrected version posted fairly quickly.
- Don Kinzer
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

An updated compiler has been posted on the Downloads Page that resolves this problem.
- Don Kinzer
Post Reply