B4J Question B4j exe file created work in background

mauriegio

Member
Licensed User
Longtime User
Hello at all,

when i create exe file with B4j create package standalone, when i run it
from a command prompt exit immediatly and continue work in background,
but i need to wait until finish, because it must create a file and after i need
to elaborate it.

How i can do it ?

Thank you very much
Maurizio
 

DonManfred

Expert
Licensed User
Longtime User
the question is how i can lunch the app and wait the finish work!!!
Create a NON-UI App. Wait for it to finish from the commandline. See google for help on how to wait for an app.
 
Upvote 0

teddybear

Well-Known Member
Licensed User
I attach the source main if can help .
thank you
You just want to create a Report.xlsx, and write a ok to finito.opn then exit app.
I wonder why you would like to lanuch it from cmd prompt. and you will do what after the file is created?
 
Upvote 0

mauriegio

Member
Licensed User
Longtime User
You just want to create a Report.xlsx, and write a ok to finito.opn then exit app.
I wonder why you would like to lanuch it from cmd prompt. and you will do what after the file is created?
i need to call from a php exec command but i need to wait the xlsx created for download when finish
opn was a test to wait from php but not working well.

thanks
 
Upvote 0

teddybear

Well-Known Member
Licensed User
i need to call from a php exec command but i need to wait the xlsx created for download when finish
opn was a test to wait from php but not working well.

thanks
why not use non-ui app?
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
without searching it... a lot... did you try moving this line:
B4X:
    File.WriteString(File.DirApp,"finito" & Utente & ".opn","OK")

into sub: CreaFileExcelXTglNico

...because you are waiting for it...
also after wait for CreaFileExcelXTglNico

add a SLEEP(3000) '(3secs) to be sure that file closed...
 
Upvote 0

teddybear

Well-Known Member
Licensed User
add a SLEEP(3000) '(3secs) to be sure that file closed...
It's useless, beacuse php exec UI-app it will return immediatly.
i tryed but do the same thing

thanks
Try calling run_debug.bat from PHP, or compiling it to non-ui jar and using java running it
 
Last edited:
Upvote 0
Top