Help with using reflector setfield

qsrtech

Active Member
Licensed User
Longtime User
Hi, I need some help. I'm trying to set a classes Fields/properties by using a "string" vs the actual variable. I need to do this cause I have properties stored on a server DB that are linked to the variable's name.

I'm trying to use this code:

B4X:
'Note:
'AProperty/ASetting are strings retrieved through a DB
'Aproperty is a field in my class, I.E. Height, Width, etc...

Dim r as Reflector

r.Target=mySettings
r.SetField2(AProperty,ASetting) 'no field in class error here

What's the correct way to do this?
Thanks!
John
 
Top