I'm trying to open the PureBasic compiler using /standby to communicate with it. Before I can send data I need to wait for the "READY" signal. But whenever I specify the #PB_Program_Read flag the program no longer waits and exits immediately.
The program closes immediately after it finishes reading the output if I use #PB_Program_Read. It won't close if I use just #PB_Program_Open but then I can't read data from it.
I don't want it to close because I haven't sent the file to be compiled to it yet. And I need to read the output to know when the compiler is "READY".
If I specify the flags #PB_Program_Open|#PB_Program_Read|#PB_Program_Write then the program sits there with a blinking cursor waiting for input.
CompilerInterface.txt says that I should get output on startup:
Except on startup, the compiler will write on the standard output only as a response of a command, so
you only need to check it for data after a command was sent. The amount of lines that are sent as a
response depends on the command that was sent. If not noted otherwise, the response is a single line only.
Immediately on startup, the compiler writes this line:
I just tried this with 4.30 on my notebook and it still closes. Am I doing something incorrectly?
I expect the compiler to remain running when I use the /STANDBY parameter so that I can communicate wit it. Am I misunderstanding how I should be interacting with it?
Freak/Fred can you provide a simple example that loads the compiler using /STANDBY, passes a .pb file, reports the current progress, and continues to wait for the next source after compilation?
The problem was that I didn't realize I could read from the window even when nothing was displayed. #PB_Program_Write is also necessary to prevent it from closing.