Looping thru the Properties of a class

IS there any way to loop thru the values of a class?

Pseudo code:

[code]for i = 0 to Unbound (class.properties)

print class.name,class.value

next
[/code]

Yes. Use Introspection.

Thanks Bob! Works well but i can’t seem get the values out (Names of the properties is easy enough.)

[code] dim myString,myValue as string
Dim myTarget() as Introspection.PropertyInfo = Introspection.GetType(theClass).GetProperties
For i as Integer=0 to Ubound(myTarget)

    If its a string   myValue = myTarget(i).value  //  If I'm on the right track here what is the freaking syntax
    If its a number  myValue = str(myTarget(i).value)  //If not where should I be looking?
    If its something else  handle or Return  "--"

myString=myString+myTarget(i).name+" : "+myValue+ EndOfLine

Next

return myString[/code]

Examples are on http://documentation.xojo.com/index.php/PropertyInfo.Value
Docs http://documentation.xojo.com/index.php/PropertyInfo.PropertyType