B4J Question How to get the value of a field declared in a code module using Reflection or JavaObject ?

TelKel81

Active Member
Licensed User
I tried with both but to no avail...

I know how to do it with class modules but the same approach doesn't work in code modules (NoSuchFieldException) despite that I can successfully iterate through the fields of the code module with the getFields method.
 

teddybear

Well-Known Member
Licensed User
I tried with both but to no avail...

I know how to do it with class modules but the same approach doesn't work in code modules (NoSuchFieldException) despite that I can successfully iterate through the fields of the code module with the getFields method.
Code module is also a class.
To JavaObjetc you can get field by jo.GetField("FldName")
To Jreflection you can get field by jr.GetStaticField("yourcodemoduleclass", "FldName")
 
Last edited:
Upvote 0
Top