RosettaCodeData/Task/Reflection-List-properties/Lingo/reflection-list-properties.lingo

12 lines
193 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
obj = script("MyClass").new()
obj.foo = 23
obj.bar = 42
-- ...
-- show obj's property names and values
cnt = obj.count
repeat with i = 1 to cnt
put obj.getPropAt(i)&" = "&obj[i]
end repeat