TypeOf

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ATOMIC
    New Member
    • Feb 2009
    • 4

    TypeOf

    Hiya

    Say I have a Employee class, and a Worker class
    Worker inherits from Employee

    Now i have an Employee object
    How can i test if this object is also a Worker ?
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    If you have a Worker object and cast it as an Employee object, the GetType() will return a type of Worker

    Comment

    • ATOMIC
      New Member
      • Feb 2009
      • 4

      #3
      Dont think you read my question
      If i have a Employee object (that is possibly a worker too)
      How can i test to see if it is a worker object also?

      Comment

      • ATOMIC
        New Member
        • Feb 2009
        • 4

        #4
        ahh hang on... perhaps u are correct
        If say i have a function:

        Public Function PayRoll(Person as Employee) as Integer

        If GetType(Person) = Worker ?? then

        end if


        End Sub

        Comment

        Working...