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
Overload difficulty within class

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



Joined: 03 Jan 2012
Posts: 7

Posted: 04 January 2012, 20:24 PM    Post subject: Overload difficulty within class Reply with quote

I hate to seem like I'm flooding this forum with questions lately, but... consider the following code:

Code:
option objects

public structure One
   public bthing as byte
end structure
   
public structure Two
   public ithing as integer
   public sthing as string
end structure   
   
   
'public class test
   private function CheckSum( byval data as One ) as UnsignedInteger
   end function

   private function CheckSum( byval data as Two ) as UnsignedInteger
   end function
'end class

public sub main()
end sub


It compiles just fine, but if you uncomment the class definitions, it won't compile; it complains that the two functions have identical signatures.

The signature of the two functions should be different, I think - they take different types of parameters. But I think the compiler is treating them simply as type structure, not type One and Two.

Is there a way around this, other than renaming my function?

Thanks!
Back to top
dkinzer
Site Admin


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

Posted: 04 January 2012, 21:17 PM    Post subject: Re: Overload difficulty within class Reply with quote

codeferret wrote:
Is there a way around this, other than renaming my function?
Unfortunately, no. This problem was discovered recently and has been corrected in our development version. I'll have to look into how complex the changes were to judge the feasibility of issuing an interim release with this correction.
Back to top
dkinzer
Site Admin


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

Posted: 09 January 2012, 18:27 PM    Post subject: Reply with quote

There is a new version of the compiler that corrects this problem among others. The new installer contains the same compiler version as well as an updated IDE that addresses a Win7 issue.
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