Other Debug Mode Issue

Swissmade

Well-Known Member
Licensed User
Longtime User
Hi all,
I get the idea, that how bigger the program gets how more Error messages I get from the Debugger.
Is there a solution for this.
I running version 2.5 because 2.8 is giving me more problems.
Bad because I like the new functions in 2.8 to use.
Please help.
 

stevel05

Expert
Licensed User
Longtime User
I have not noticed this as an issue, please be more specific with the messages you are getting and fix them one at a a time.
 
Upvote 0

Swissmade

Well-Known Member
Licensed User
Longtime User
The Strange thing is that I try to get and set text to a Titled pane.
Sometimes it is working sometimes not.
Seems something is going to fast,
Move the call lower in the function it is also working in the Debugger.
SetRecreation is called in APPStart at the end.
I hope this helps.

B4X:
Private Sub SetRecreation
Try
   lstEmergencyTeam.Visible = False
   lblEmergencyTeamCount.Visible = False
   mnuVisitor.Visible = False
   btnEditVisitors.Visible = False
   Dim ap As AnchorPane
   ap.Initialize("")
   ap.LoadLayout("frmRecreationMenu")
   Dim img As Image
   img.Initialize(File.DirAssets, "Abo-Img.png")
   ABOImgRecreation.SetImage(img)
   img.Initialize(File.DirAssets, "Barcode.png")
   DayImgRecreation.SetImage(img)
   DayImgRecreation.PreserveRatio = False
   EmergTitledAnchorPane.AddNode(ap, -5, -5, -5, -5)

   Log(Functions.GetTitledPaneText(EmergTitledPane))
   Functions.setTitledPaneText(EmergTitledPane, "Recreation")
Catch
   Functions.ShowLog("Error Set Recreation", False)
End Try
End Sub

Sub setTitledPaneText(TP As Node, Text As String )
  Dim jo As JavaObject = TP
  jo.RunMethod("setText", Array As Object(Text))
End Sub

Sub GetTitledPaneText(TP As Node) As String
Try
  Dim jo As JavaObject = TP
  Return jo.RunMethod("getText", Null)
Catch
    ShowLog("Error in Getting Titled Pane Text", False)
End Try
End Sub
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
So if you remove the try block, what is the exact error you get?
 
Upvote 0

Swissmade

Well-Known Member
Licensed User
Longtime User
I have moved the rows up again and the I get this Error.

Line 788 is GetTitledPaneText
If I disable setTitledPaneText(EmergTitledPane, "Recreation") I don't get this error.
I don't get this all the time and that is what I find strange.


Error occurred on line: 788 (functions).
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:563)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:221)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:82)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
at tcp.server.main.start(main.java:35)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$153(LauncherImpl.java:821)
at com.sun.javafx.application.LauncherImpl$$Lambda$51/66904104.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$166(PlatformImpl.java:323)
at com.sun.javafx.application.PlatformImpl$$Lambda$44/1099983479.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$164(PlatformImpl.java:292)
at com.sun.javafx.application.PlatformImpl$$Lambda$47/1270527242.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(PlatformImpl.java:291)
at com.sun.javafx.application.PlatformImpl$$Lambda$46/1401420256.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102)
at com.sun.glass.ui.win.WinApplication$$Lambda$37/1394438858.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
tcp.server.functions:_gettitledpanetext, [(TitledPane) TitledPane[id=EmergTitledPane, styleClass=titled-pane]'Emergency Team', Text: Emergency Team, ]
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Is EmergTitledPane defined as a Node or a Pane?
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
I would try using CallSubDelayed to call SetRecreation from within AppCreate. It's possible that the layout is not completed when you are calling GetTitle.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
The subname should be a string: CallSubDelayed(Me, "SetRecreation")

I've played with getting/setting the title on a titlepane and can't get it to fail as yours is. If setting the subname as a string doesn't fix it, perhaps you can post some working code that shows the error.
 
Upvote 0

Swissmade

Well-Known Member
Licensed User
Longtime User
(Me, "SetRecreation")

Forgot the "" but even with this it is working sometimes and sometimes not.
I think, that I have to put the call to the Function to an other places where the form is finish showing.
Will solve this I think.
 
Upvote 0

Swissmade

Well-Known Member
Licensed User
Longtime User
(SOLVED )
Place the Function before I show the MainForm.

Thanks Stevel05
 
Last edited:
Upvote 0
Top