|
|
| Author |
Message |
GTBecker
Joined: 18 Jan 2006
Posts: 457
Location: Cape Coral
|
|
Posted: 25 January 2010, 1:21 AM Post subject: Boolean init |
|
|
What's wrong here? (ZX-24n)
| Code: | dim ShutterAuto as boolean = True
Sub Main()
console.write(cstr(ShutterAuto))
end sub |
|
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 25 January 2010, 1:33 AM Post subject: Re: Boolean init |
|
|
| GTBecker wrote: | | What's wrong here? (ZX-24n) | What are you seeing? The release candidate that we're currently testing compiles that code without error for both native mode and VM mode. |
|
| Back to top |
|
 |
GTBecker
Joined: 18 Jan 2006
Posts: 457
Location: Cape Coral
|
|
Posted: 25 January 2010, 1:51 AM Post subject: Boolean init |
|
|
It reports False. The boolean does not seem initialized.
Tom |
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 25 January 2010, 17:25 PM Post subject: Re: Boolean init |
|
|
| GTBecker wrote: | | It reports False. The boolean does not seem initialized. | Confirmed. There is an error in the native mode code generation for the v2.8.x series. The issue was corrected some time ago in our current development version. The correction will be in the upcoming release.
In the mean time, a workaround is to add explicit initialization in Main(). | Code: | dim ShutterAuto as boolean
Sub Main()
ShutterAuto as boolean = True
console.write(cstr(ShutterAuto))
end sub |
An alternate workaround is to install the Beta version posted for the object extension testing.
http://www.zbasic.net/download/ObjExt/ZBasic_Beta_2-9-4.zip |
|
| Back to top |
|
 |
GTBecker
Joined: 18 Jan 2006
Posts: 457
Location: Cape Coral
|
|
Posted: 25 January 2010, 17:46 PM Post subject: Boolean init |
|
|
> ... An alternate workaround is to install the Beta version posted for
the object extension testing.
http://www.zbasic.net/download/ObjExt/ZBasic_Beta_2-9-4.zip
That one has a SPDR0 error for ZX-24ns, so I'll just set the boolean in
Main. Thanks. |
|
| Back to top |
|
 |
stevech
Joined: 23 Feb 2006
Posts: 657
|
|
Posted: 25 January 2010, 19:50 PM Post subject: Re: Boolean init |
|
|
| Code: | dim ShutterAuto as boolean
Sub Main()
ShutterAuto as boolean = True
console.write(cstr(ShutterAuto))
end sub |
Just wondering: in the above, first line of Main(), is the "as boolean" essential since the variable has been already been declared? |
|
| Back to top |
|
 |
GTBecker
Joined: 18 Jan 2006
Posts: 457
Location: Cape Coral
|
|
Posted: 25 January 2010, 20:03 PM Post subject: Re: Boolean init |
|
|
| Code: |
ShutterAuto as boolean = True |
Surely a typo. That won't compile. |
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 25 January 2010, 20:14 PM Post subject: Re: Boolean init |
|
|
| GTBecker wrote: | | Surely a typo. | Indeed. I didn't review it carefully enough after the copy/paste. |
|
| Back to top |
|
 |
|