Hi, I try to use Reflector for take a value from a field of my object.
I read this: https://www.b4x.com/android/help/reflection.html#reflector
I've a class Product and I create an istance of it.
Dim product As Product
product.Initialize
product.COD_RIORD = "1234567890"
product.CODEAN = "501489592615"
product.DESCRIPTION = "STAR WARS FIGURES..."
product.PRICE = "6,45"
Every fields have set and get in class.
Now, I try to use Reflector.
Dim x As Reflector
Dim var as string = "PRICE"
x.Target = product
Log(x.GetField(sf.Lower(var)))
Last istruction raise an exception.
Can you help me?
Matteo
I read this: https://www.b4x.com/android/help/reflection.html#reflector
I've a class Product and I create an istance of it.
Dim product As Product
product.Initialize
product.COD_RIORD = "1234567890"
product.CODEAN = "501489592615"
product.DESCRIPTION = "STAR WARS FIGURES..."
product.PRICE = "6,45"
Every fields have set and get in class.
Now, I try to use Reflector.
Dim x As Reflector
Dim var as string = "PRICE"
x.Target = product
Log(x.GetField(sf.Lower(var)))
Last istruction raise an exception.
Can you help me?
Matteo