Announcement

Collapse
No announcement yet.

overriding methods

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • overriding methods

    I am new to PowerBasic and at the moment struggling with terminology and a new way of doing things. However, I must say I have been enjoying the ride.
    My present puzzle is a compiler error I get - MISMATCH WITH PRIOR DEFINITION - when to me it looks exactly the same. I have a parent class that contains methods I want overridden as well as a class that inherits from it. This contains the OVERRIDE methods. The parent methods to be overridden look like:

    '=============================methods to be overriden=============
    METHOD setBeginOfFile()
    mFile.clear()
    END METHOD

    METHOD setEndOfFile()
    mFile.clear()
    END METHOD

    METHOD checkRange() AS INTEGER
    METHOD = 0
    END METHOD

    METHOD checkFilter() AS INTEGER
    METHOD = 0
    END METHOD

    METHOD setColumnSearch(key AS STRING)
    END METHOD

    METHOD columnClicked(col AS INTEGER)
    END METHOD

    METHOD putInGrid(row AS INTEGER, refresh AS INTEGER)
    END METHOD

    METHOD setUpColumns
    END METHOD

    METHOD getAssociatedData AS INTEGER
    METHOD = 0
    END METHOD
    '=============================end of overrides====================

    The derived class looks like this:

    CLASS myLv
    CLASS METHOD CREATE()
    mybase.create()
    END METHOD
    INTERFACE myLvif
    INHERIT cgListview,cgLview
    OVERRIDE METHOD checkFilter() AS INTEGER
    IF mybase.mFile.getfield("fgactive") <> "1" THEN
    METHOD = -1
    ELSE
    METHOD = %OK
    END IF
    END METHOD
    END INTERFACE
    END CLASS

    The line that gives trouble is the OVERRIDE METHOD.

    Can anyone please put me straight. Thanks


    DON'T WORRY, I DISCOVERED THAT IF I USE "AS LONG" INSTEAD OF "AS INTEGER" THE COMPILER IS HAPPY. I MUST HAVE MISSED SOMETHING IN THE DOCUMENTATION
    Last edited by Hilton Grimbeek; 17 Jun 2009, 05:52 AM.
Working...
X