Forum Discussion

rwestbury's avatar
rwestbury
Contributor
14 years ago

Grabbing Properties via String

Hi,



Is it possible to grab the value of a certain property, when I have the property and value I'm interested in saved in variables?



For example, I want to be able to do this:



'Assume property = "Left", and expectedValue = 22



If object.getValue(property) <> expectedValue Then

     Fail

End If



Thank you,



Robert.

2 Replies

  • I have solved the problem. The solution is to use GetPropertyValue. Using this built-in method you can access the value of a property of an object when your property is in String form. The usage to my best knowledge thus far is as follows:



    GetPropertyValue(Object as Object, Property as String), where Object is Sys.Process... etc, and Property is "Left", or "Visible"... etc. The method will return the Value of the Property.



    Regards,



    Robert.