More VB - Why won't this compile?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • crokett
    The Full Monte
    • Jan 2003
    • 10627
    • Mebane, NC, USA.
    • Ryobi BT3000

    #1

    More VB - Why won't this compile?

    I have this code:

    Code:
    Public Class class1 
    End Class
     
    Public Class class2 Inherits class1
    End Class
    And it does not compile. I get an 'end of statement expected' error message every time on the line where class2 inherits. If I comment out everything after class2 then the error goes away. If I define an interface and class2 implements instead of inherits I get the same error.

    I am using VB 2005.NET Express Edition if that matters.
    Last edited by crokett; 09-21-2007, 03:51 PM.
    David

    The chief cause of failure in this life is giving up what you want most for what you want at the moment.
  • Hoakie
    Established Member
    • Feb 2007
    • 382
    • Iowa
    • Craftsman 21829

    #2
    Then inherits call needs to be on the first line AFTER the class delcaration, (dunno why they did it this way but there are a lot of things like that )

    Public Class class1
    End Class


    Public Class class2
    Inherits class1
    End Class
    John
    To invent, you need a good imagination and a pile of junk. ~ Edison

    Comment

    • crokett
      The Full Monte
      • Jan 2003
      • 10627
      • Mebane, NC, USA.
      • Ryobi BT3000

      #3
      You realize of course that this is reason # 1,357 wht I don't make my living at this.

      thanks.
      David

      The chief cause of failure in this life is giving up what you want most for what you want at the moment.

      Comment

      • Alex Franke
        Veteran Member
        • Feb 2007
        • 2641
        • Chapel Hill, NC
        • Ryobi BT3100

        #4
        Wow, interesting. I think that would have driven me up a wall! (...kind of like when I find myself typingInCamelCase, ending sentences with semicolons, and (oh yeah!) using nested parentheses; )
        online at http://www.theFrankes.com
        while ( !( succeed = try() ) ) ;
        "Life is short, Art long, Occasion sudden and dangerous, Experience deceitful, and Judgment difficult." -Hippocrates

        Comment

        • drumpriest
          Veteran Member
          • Feb 2004
          • 3338
          • Pittsburgh, Pa, USA.
          • Powermatic PM 2000

          #5
          This is why I love my C/C++ and Cg and GLSL and HLSL, mostly they make more sense. I really get bugged by the languages that use white space for scope and that sort of thing. *cough cough* *python*
          Keith Z. Leonard
          Go Steelers!

          Comment

          • tedkitch
            Senior Member
            • Jul 2006
            • 646
            • NE Suburbs, Chicago
            • Ryobi BT3100 What else is there?

            #6
            Originally posted by drumpriest
            This is why I love my C/C++ and Cg and GLSL and HLSL, mostly they make more sense. I really get bugged by the languages that use white space for scope and that sort of thing. *cough cough* *python*
            Did you see the article on Digg where Linus Torvalds said that C++ was the worst language? I was amazed at that. He didn't have anything really good to say about. If you didn't see the article, you can read it here.
            Ted Kitch

            Comment

            Working...