Excuse what is probably the ‘dumb question of the day’ but I need your wisdom! (I have been trying to do this myself, using searches on here to help, sadly, I’m beaten!).
I need a way to iterate through properties on a window to see if one with a given name exists, and, if it does, what it’s value is (it’s a string).
Since you’ve mentioned that you’re a newbie - let’s start with the proposition that Introspection, while useful in some cases, should be the tool of last resort. There are usually better (and more easily understood) ways of doing things in Xojo.
With that in mind, why don’t you tell us a little more about what you are trying to accomplish and perhaps we can offer you a better suggestion?
var w as DesktopWindow = self //Pointer to class to inspect
var info as Introspection.TypeInfo = Introspection.GetType(w)
if info = nil then
System.DebugLog("Odd")
return
end if
var props() as Introspection.PropertyInfo = info.GetProperties
//loop through all properties attached
for each p as Introspection.PropertyInfo in props
//look for Strings
if p.PropertyType.Name.Lowercase = "string" then
//Found a string
system.DebugLog("Found String """ + p.Name + """ with value """ + p.Value(w).StringValue) + """"
end if
next p