Version 3.2
I have the following code in Main
This fails at runtime with and exception invalid double "null".
PackageAdded: package:b4a.example
** Activity (main) Create, isFirst = true **
java.lang.NumberFormatException: Invalid double: "null"
at java.lang.StringToReal.invalidReal(StringToReal.java:63)
at java.lang.StringToReal.parseDouble(StringToReal.java:269)
at java.lang.Double.parseDouble(Double.java:295)
at anywheresoftware.b4a.BA.ObjectToNumber(BA.java:585)
at b4a.example.main._activity_create(main.java:305)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:173)
at b4a.example.main.afterFirstLayout(main.java:98)
at b4a.example.main.access$100(main.java:16)
at b4a.example.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
It also does not seem to run the CallsubTarget code (or at least fails to hit a breakpoint on the return line. Is the CallsubTarget optimised out?
There is a suggestion in some documentation that the first parameter for CallSub should be the module name (Main in this case) but CallSub(Main,"CallsubTarget") gives an compile error, me seems to be accepted by the compiler though.
I have the following code in Main
B4X:
Sub CallsubTarget As Int
Return 1
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim i As Int
i = CallSub(Me,"CallsubTarget")
This fails at runtime with and exception invalid double "null".
PackageAdded: package:b4a.example
** Activity (main) Create, isFirst = true **
java.lang.NumberFormatException: Invalid double: "null"
at java.lang.StringToReal.invalidReal(StringToReal.java:63)
at java.lang.StringToReal.parseDouble(StringToReal.java:269)
at java.lang.Double.parseDouble(Double.java:295)
at anywheresoftware.b4a.BA.ObjectToNumber(BA.java:585)
at b4a.example.main._activity_create(main.java:305)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:173)
at b4a.example.main.afterFirstLayout(main.java:98)
at b4a.example.main.access$100(main.java:16)
at b4a.example.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
It also does not seem to run the CallsubTarget code (or at least fails to hit a breakpoint on the return line. Is the CallsubTarget optimised out?
There is a suggestion in some documentation that the first parameter for CallSub should be the module name (Main in this case) but CallSub(Main,"CallsubTarget") gives an compile error, me seems to be accepted by the compiler though.