|
|
| Author |
Message |
bodir
Joined: 05 Sep 2006
Posts: 3
|
|
Posted: 06 September 2006, 19:42 PM Post subject: Internal error |
|
|
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
'======================================================================================= |
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 07 September 2006, 0:29 AM Post subject: |
|
|
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: | 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. |
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 08 September 2006, 4:21 AM Post subject: |
|
|
| An updated compiler has been posted on the Downloads Page that resolves this problem. |
|
| Back to top |
|
 |
|