Heloo Aeric
You're right, the code is quiet redundant
Anayway, I thnk I've found a way to distinguish between IDE status and Standalone status.
Perhaps this is not the more elegant way, but it works.
What I do is to use the simple instruction File.DiRapp
This instruction gives you different values depending the status of the running program.
In case of IDE environment, the last folder of the chain is "Objects"
In case of standalone running the last folder of the chain is "bin"
So based on this difference I added these simple instructions to the sample program generated by the B4J IDE
Sub AppStart (Form1 As Form, Args() As String)
text= File.DirApp
Log ("File.dirapp : "& text)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
Label2.Text= text
index= File.DirApp.IndexOf("bin")
Log("index : "& index)
If index > 0 Then
Log ("I'm running in standalone condition")
Else
Log ("I'm running under IDE environment")
End If
End Sub
And it works
I also attach pictures of both situations showing the result
I hope this helps the people, until someboy clever than me ( quite easy), gives another option
Thanks to everybody