B4J Question Arguments

DarkoT

Active Member
Licensed User
Hi,
maybe will be this stupid question - but - someone says that is no stupid questions, just stupid answares...

It's posible to start B4J UI app with arguments from command line? If yes - how can pass parameters in debug mode (from B4J IDE)..

Thanks...
 

DarkoT

Active Member
Licensed User
Use JShell to start any program. Even with Parameters.
No, no... I want to pass paramether from another application INTO b4j application (ERP will start my utility app written in B4J and pass some link, B4J App need to open this link and save content from the link to file)...
How can I test B4J App in debug with arguments... In visual studio (I basicaly switch from VS to B4J with almoust all of my projects) is simple:

 
Upvote 0

DarkoT

Active Member
Licensed User
java -jar JarExample.jar "arg 1" arg2@
Okeyyy, that's it... In debug mode? I assume, that I can also start debug proces from IDE with parameters:

Example - Arguments:
#Region Project Attributes
    #MainFormWidth: 600
    #MainFormHeight: 600
    #CommandLineArgs: Darko Test Uiii
#End Region
 
Upvote 0

DarkoT

Active Member
Licensed User
no, thats for release. To debug you need to use #CommandLineArgs

You you wanted to start a app from another app. You can NOT run them in debug in this case!

To debug you NEED to USE the IDE.
If I do this:
Example - Arguments:
#Region Project Attributes
    #MainFormWidth: 600
    #MainFormHeight: 600
    #CommandLineArgs: Darko Test Uiii
#End Region
the system will not run/work in debug...
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
. . . the system will not run/work in debug...
This works for me ...
B4X:
#Region Project Attributes
    #MainFormWidth: 600
    #MainFormHeight: 600
    #CommandLineArgs: Darko Test Uiii
#End Region

Private Sub AppStart (Form1 As Form, Args() As String)
    Log(Args(0) & Args(1) & Args(2))
    ... ... ...

. . . . in Debug and Release. Maybe I misunderstand what you are trying to do.
 
Upvote 0

DarkoT

Active Member
Licensed User
Do you get any error in the log?
NOT RUN ist a bad request for help.
No, nothing... The system waits and wil not start...
If you want to check - I cann give you full project (is very small)
 
Upvote 0

emexes

Expert
Licensed User
It's posible to start B4J UI app with arguments from command line?

Another way might be to run your app via a script/batch file, which can write its arguments and/or various environment variables into a plain text file which your app can read from instead of from the command line.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…