[Mono-list] Keyword this or base expected(CS1018)

Gaurav Vaish Gaurav Vaish <gaurav.vaish@gmail.com>
Sun, 22 Aug 2004 13:24:07 +0530


Rob,

  Can you give the details of:

  - The base class (namespace, name and preferably, also the constructors)
  - What you intend to do in your sub-class, if non-classified.

  We may be able to help you better...

  Having said that, Gennady's example would be the perfect starting
point for you to pickup.


Cheers,
Gaurav
http://gallery.mastergaurav.net
------------------------------



On Sun, 22 Aug 2004 16:56:55 +1200, Rob Brown-Bayliss <rbb@orcon.net.nz> wrote:
> 
> OK, so how do I pass args to the base class?
> 
> I thought:
> 
> MyClass my_class = new MyClass(gxml, database);
> 
> would pass gxml and database to the base class of MyClass?
> 
> 
> 
> > This is wrong.
> >
> > While calling the contructor, the gxml and database are undefined. If
> > you be appropriate to call as:
> >
> > public MyClass(): base(null, null)
> > {
> > ...
> > }
> >
> > or better still:
> >
> > public MyClass(): base( (Glade.XML) null, (Database) null )
> > {
> > ...
> > }
> >
> > Use the latter option if there are more than one overloaded
> > consturctor in the base class that can make up for BaseClass(null,
> > null).
> >
> > NB: I have assumed that Glade.XML is not enum.
> >
> >
> >
> > Cheers,
> > Gaurav Vaish
> > http://gallery.mastergaurav.net
> > -----------------------------------
> >
> >
> > On Sun, 22 Aug 2004 16:19:03 +1200, Rob Brown-Bayliss <rbb@orcon.net.nz> wrote:
> > >
> > > Why does this:
> > >
> > > public MyClass() : base (Glade.XML gxml, Database database)
> > >
> > > give me this error?
> > >
> > > Keyword this or base expected(CS1018)
> 
> --
> Rob Brown-Bayliss
> 
> ________________________________________________________________________
>