> [SOLVED]
> 
> Kadaitcha Man wrote:
> > 2009/12/2 kevinfishburne <kevinfishbu...@eightvirtues.com>:
> >> (2) Module "Server" then calls the procedure "Init" contained within
> >> module
> >> "Net" (Net.Init).
> >
> > Net is reserved for the Net class of constants in gambas. Rename the
> > module.
> >
> > -------------------------------------------------------------------------
> >----- Join us December 9, 2009 for the anonymous postings of fortune
> > stdout!!! _______________________________________________
> > Gambas-user mailing list
> > Gambas-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
> Thanks. Renaming the network module from "Net" to "Network" worked. I'm
>  glad is was a simple mistake. Thanks again.
> 

It's not totally a mistake of yours, but a decision made by the compiler the 
first time the "Net" identifier is encountered: 

"Should I use the global Net class from the gb.net component or the Net class 
defined in the project?"

The common programmer logic would tell to decide the second solution. But then 
we are hiding a class of an official component, which is not a good idea. It 
makes the program less readable, a bit like when you override operators in 
C++: a well-known language "thing" actually does not do what it should at 
first sight.

So I chose the first solution, which usually prints an error when you try to 
access your class.

If you really want mixing your own Net class with the official one, you can 
export it. This way, your own class will inherit and override the Net official 
class, so that you can add the feature you need to it.

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to