7 Replies - 672 Views - Last Post: 06 October 2012 - 02:53 PM Rate Topic: -----

#1 zox  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-October 12

'MyBase' must be followed by '.' and an identifier.

Posted 06 October 2012 - 12:17 PM

Hi

i getting 24 same errors 'MyBase' must be followed by '.' and an identifier.

   <DebuggerNonUserCode()> _
            Public Property Naziv() As String
                Get
					Return CStr(MyBase(Me.tableArtikli.NazivColumn))
                End Get
                Set(ByVal value As String)
					MyBase(Me.tableArtikli.NazivColumn) = value
                End Set
            End Property


i try to remove MyBase but then i get another error "Syntax error." at (


Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: 'MyBase' must be followed by '.' and an identifier.

#2 lucky3  Icon User is offline

  • Friend lucky3 As IHelpable
  • member icon

Reputation: 231
  • View blog
  • Posts: 765
  • Joined: 19-October 11

Re: 'MyBase' must be followed by '.' and an identifier.

Posted 06 October 2012 - 12:26 PM

MyBase is parent class, from which this class inherits. For example:

Public Class ParentClass
    Public Property ParentName As String
End Class

Public Class ChildrenClass
    Inherits ParentClass
    Public Property ChildrensName As String
        Get
            Return MyBase.ParentName
        End Get
        

        Set(ByVal value As String)
            MyBase.ParentName = value
        End Set
    End Property
End Class



Edit: correcting typo in code

This post has been edited by lucky3: 06 October 2012 - 12:51 PM

Was This Post Helpful? 0
  • +
  • -

#3 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5535
  • View blog
  • Posts: 11,857
  • Joined: 02-June 10

Re: 'MyBase' must be followed by '.' and an identifier.

Posted 06 October 2012 - 12:28 PM

and what is 'myBase'? were not telepathic or looking at your screen.
is it a namespace, a method, a class...?
Was This Post Helpful? 0
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2263
  • View blog
  • Posts: 9,468
  • Joined: 29-May 08

Re: 'MyBase' must be followed by '.' and an identifier.

Posted 06 October 2012 - 02:02 PM

@tlhIn`toq: As lucky3 as mentioned MyBase is the way for a class to refer to the class it derives / inherits from.

Me refers to instance of the class itself. this.
In c# this would be base .

This post has been edited by AdamSpeight2008: 06 October 2012 - 02:03 PM

Was This Post Helpful? 0
  • +
  • -

#5 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5535
  • View blog
  • Posts: 11,857
  • Joined: 02-June 10

Re: 'MyBase' must be followed by '.' and an identifier.

Posted 06 October 2012 - 02:11 PM

Lucky3 and I must have been typing at roughly the same time: Him realizing we needed an explanation of myBase, and me asking for it.
Was This Post Helpful? 0
  • +
  • -

#6 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2263
  • View blog
  • Posts: 9,468
  • Joined: 29-May 08

Re: 'MyBase' must be followed by '.' and an identifier.

Posted 06 October 2012 - 02:36 PM

And where is your research tlhIn`toq? As you are so often professing others do. Hmm?
Do want me to do it for you? MSDN: MyBase
Was This Post Helpful? 0
  • +
  • -

#7 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5535
  • View blog
  • Posts: 11,857
  • Joined: 02-June 10

Re: 'MyBase' must be followed by '.' and an identifier.

Posted 06 October 2012 - 02:45 PM

The page you referenced seems to indicate this is for VS2003/2005.

I am always fine admitting when I have never heard of something - especially in this age frame.

I honesty expected "myBase" to be a user construct of some kind. It sounds like it is an instance of their base class. Just like "myParent" would be a very common name for an instance of a "Parent" class, or "myRam" would be an instance of the "Ram" class.

But I get what you're really saying: "Please stay out of the VB.NET forum as you don't really have the knowledge for it." No problem.
Was This Post Helpful? 0
  • +
  • -

#8 lucky3  Icon User is offline

  • Friend lucky3 As IHelpable
  • member icon

Reputation: 231
  • View blog
  • Posts: 765
  • Joined: 19-October 11

Re: 'MyBase' must be followed by '.' and an identifier.

Posted 06 October 2012 - 02:53 PM

I will apologize to new member zox here, because of partial hijacking of the thread. tlhIn`toq you are most welcome on VB.NET sub-forum. I really enjoy reading your posts in C# and VB.NET. For example today, there were some really great details pointed out in Cross Thread Call (C#), and we need such insights here, too.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1