No announcement yet.

Error 414 ")" expected

  • Filter
  • Time
  • Show
Clear All
new posts

  • Error 414 ")" expected

    I know...It's probably something simple I've overlooking, but why am I getting error 414

    #Compile Exe
    #Dim All
    ' -----------------------------------------------------------------------------
    ' ----- Class Definition
    Class CPoint3D
        Instance m_x, m_y, m_z As Long
        ' -------------------------------------------------------------------------
        ' ----- Interface Definition
        Interface IPoint3D : Inherit IUnknown
            Method Copy( ByVal o As IPoint3D )
                m_x = o.X
                m_y = o.Y
                m_z = o.Z
            End Method  ' Copy
            ' X
            Property Get X() As Long : Property = m_x : End Property
            Property Set X( l As Long ) : m_x = l : End Property
            ' Y
            Property Get Y() As Long : Property = m_y : End Property
            Property Set Y( l As Long ) : m_y = l : End Property
            ' Z
            Property Get Z() As Long : Property = m_z : End Property
            Property Set Z( l As Long ) : m_z = l : End Property
        End Interface   ' IPoint3D
    End Class   ' CPoint
    ' -----------------------------------------------------------------------------
    ' ----- Class Definition
    Class CLine3D
        Instance m_A, m_B As IPoint3D
        Class Method Create()
            m_A = Class "CPoint3D"
            m_B = Class "CPoint3D"
        End Method  ' Create
        ' -------------------------------------------------------------------------
        ' ----- Interface Definition
        Interface ILine3D : Inherit IUnknown
            ' ----- PUBLIC Methods
            Method Copy( ByVal o As ILine3D )
                m_A.Copy( o.A )                 ' <--- [B]Error 414[/B] in [this file](51:028): ")" expected
                m_B.Copy( o.B )
            End Method  ' Copy
            ' ----- PUBLIC Properties
            ' Point A
            Property Get A() As IPoint3D : Property = m_A : End Property
            ' Point B
            Property Get B() As IPoint3D : Property = m_B : End Property
        End Interface   'ILine3D
    End Class   ' CLine3D
    Function PBMain() As Long
    End Function
    If I add another parenthesis, or if I remove both it works...

  • #2
    Interesting, its the same object however it must not like the "." this does work
            METHOD COPY( BYVAL o AS ILine3D )
                DIM lA AS IPoint3D
                DIM lB AS IPoint3D
                LET lB = o.B
                LET lA = o.A
                m_A.Copy( lA )
                m_B.Copy( lB )
            END METHOD  ' Copy
    And so does

            METHOD COPY( BYVAL o AS ILine3D )
                m_A.Copy( o )
                m_B.Copy( o )
            END METHOD  ' Copy
    And o is clearly the wrong object...

    PB Must have a COM implementation issue. the issue that you have is perfectly acceptable in languages like VB/C++ and VBSCRIPT
    Sr. Software Development Engineer and Sr. Information Security Analyst,
    CEH, Digital Forensic Examiner


    • #3

      So is it an error in the compiler or in my way of thinking that is supposed work? If I do put in the extra parenthesis or leave them off all together it seems to do what I'd expect it to do.

      Thanks again,


      • #4
        Hi David--

        Sorry to see you had a problem. Just to set the record straight, this is not a "COM implementation issue" as was claimed. Please ignore that advice, as it will just lead you down the wrong path.

        That said, it is just a minor issue in parentheses counting in the compiler. When you pass a Method/Property which returns an object as a parameter, one closing parentheses may be skipped in some circumstances. The solution is exactly what you did: add an extra parentheses, or remove both of them. It's perfectly safe to do this, as it has absolutely no effect on code generation.

        Sorry you encountered this error. I hope it didn't cause too much trouble. This will be corrected in the next update, due fairly soon.

        Best regards,

        Bob Zale
        PowerBASIC Inc.


        • #5
          No trouble at all. (Except for a minor bout of confusion - which for me is just too easily done..)

          Thanks for the reply.