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
enum eee ' an enum type

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



Joined: 23 Feb 2006
Posts: 688

Posted: 21 September 2006, 4:58 AM    Post subject: enum eee ' an enum type Reply with quote

can structures contain enum types?
(subtitle: what have I done wrong?)

Code:

enum eee  ' an enum type
   alpha
   beta
end enum

structure foo ' a structure containing an enum type
   dim x as byte
   dim it as eee
end structure

dim bar as foo   ' instance of a structure

dim an_eee as eee ' instance of an enum type as module global

sub main()
   an_eee = alpha ' works OK
   bar.x = 1
   bar.it = alpha ' gives assignment error, type conflict
end sub
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 21 September 2006, 22:25 PM    Post subject: Re: enum eee ' an enum type Reply with quote

stevech wrote:
can structures contain enum types?(subtitle: what have I done wrong?)

Your example should compile but, as you observed, it does not.

The cause of the error has been found and a solution identified. We should be able to get this change into the soon-to-be-released next version.
Back to top
stevech



Joined: 23 Feb 2006
Posts: 688

Posted: 21 September 2006, 23:49 PM    Post subject: Reply with quote

thanks a zillion. no rush.
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