Results 1 to 6 of 6

Thread: TypeOf question

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 1999
    Posts
    6

    Exclamation

    Is there another way to find the type of an object other than the TypeOf statement? If I check for types of controls that aren't included in the project, it generates an error which can't be handled. I've considered using the Object object and just try every property (.Text, .Caption etc) but that seems kind of sloppy. Any suggestions?

    Thanks.

    Drew

  2. #2
    Guest
    Why can't the Error be handled? Try placing an On Error Resume Next at the top of your code and test it out.

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    the typof syntax is
    If TypeOf MyControlinstance Is MyControltype Then
    what do you have?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    TypeName(Controlinstance) returns the type name
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 1999
    Posts
    6
    Thanks kedaman, that solved my problem.

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 1999
    Posts
    6
    Megatron: It's not a runtime error, it's a compile error.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width