Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
Boolean init

 
Post new topic   Reply to topic    Forum Index -> ZBasic Language
Author Message
GTBecker



Joined: 18 Jan 2006
Posts: 457
Location: Cape Coral

Posted: 25 January 2010, 1:21 AM    Post subject: Boolean init Reply with quote

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 Reply with quote

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 Reply with quote

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 Reply with quote

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 Reply with quote

> ... 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 Reply with quote

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 Reply with quote

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 Reply with quote

GTBecker wrote:
Surely a typo.
Indeed. I didn't review it carefully enough after the copy/paste.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic Language Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group