Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Type myType(name As String,age As Int,height As Int)
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Show
Dim a As myType
a.Initialize
' the next line calls the getFields method in the #if java block
' it passes the class of the type (type is a class)
Log(asJO(Me).RunMethod("getFields",Array(asJO(a).RunMethod("getClass",Null)))) ' call the inline function
End Sub
Sub asJO(o As JavaObject)As JavaObject
Return o
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
#if java
import java.lang.reflect.Field;
public static String getFields(Class c){
String fs = "";
Field[] f = c.getDeclaredFields();
for (Field ff : f){
fs += ff.getName().toString()+"\t";
fs += ff.getType().getSimpleName().toString()+"\n\n";
}
return fs;
}
#End If