|
-
Sep 6th, 2004, 09:07 AM
#1
Thread Starter
Lively Member
Test if Object Property Exists
I am working on a program that investigates the DOM object, mostly as a learning process for myself.
My program displays characteristics of an element that it finds, but in the DOM, the attributes ie 'Name' are not consistent for all types of elements (Tags).
Is there a test to check for the presence of a given property, method etc that I can make beforehand to avoid generating errors when I try to retrieve the data in a generalized routine?
It seems there would be a method that would apply to objects in general.
Thanks in advance.
-
Sep 6th, 2004, 09:12 AM
#2
Retired VBF Adm1nistrator
You can use error trapping to ensure that the error doesn't crash your app, and then if an error occurs, print out something and then continue to the next attempt.
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Sep 6th, 2004, 09:17 AM
#3
Thread Starter
Lively Member
Yes, thought of that, just seems like a back door approach to what should be a common question when dealing with objects that are you are not real familiar with.
-
Sep 6th, 2004, 09:22 AM
#4
Retired VBF Adm1nistrator
Well the developer's the only person that'll ever need to use them, so either get the spec. from the developer of the object, or early bind to the object if possible...
... of course, all this is academic if you use .NET because you can use xml web services
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|