Hello all, I use PB 4.20 & 4.30.
Actually, I look for a solution for restarting a compiler by code under Windows & Linux. Have you got some code ?
Thanks for advance...
Bye
Restart Compiler
Restart Compiler
Last edited by Progi1984 on Sat Nov 22, 2008 3:09 pm, edited 1 time in total.
By restarting the compiler, I wish that the compiler detects again all new userlibs created or userlibs created back.
Par redémarrer le compilateur, je souhaite que le compilateur détecte toutes les nouvelles userlibs créés ou celles recréés/modifiés.
What you said means that ?
Have you any small code for explaining your "dires"?
Par redémarrer le compilateur, je souhaite que le compilateur détecte toutes les nouvelles userlibs créés ou celles recréés/modifiés.
What you said means that ?
Code: Select all
I connect to pbcompiler with -sb argument. I send an END command. I reconnect to pbcompiler with -sb argument.
Is this code correct ? For Windows & Linux ?
Code: Select all
Global hCompiler.l
ProcedureDLL PB_Connect()
Protected ReponseComp.s
; hCompiler = RunProgram(#PB_Compiler_Home+"compilers\pbcompiler.exe", "/STANDBY", "", #PB_Program_Open|#PB_Program_Read|#PB_Program_Write|#PB_Program_Hide)
hCompiler = RunProgram(#PB_Compiler_Home+"compilers/pbcompiler", "-sb", "", #PB_Program_Open|#PB_Program_Read|#PB_Program_Write|#PB_Program_Hide)
If hCompiler = 0
ProcedureReturn #False
Else
While ProgramRunning(hCompiler)
If AvailableProgramOutput(hCompiler)
ReponseComp = ReadProgramString(hCompiler)
Debug ReponseComp
If ReponseComp = "READY"
ProcedureReturn #True
EndIf
EndIf
Wend
EndIf
EndProcedure
ProcedureDLL PB_RestartCompiler()
Protected ReponseComp.s
WriteProgramStringN(hCompiler, "END")
CloseProgram(hCompiler)
ProcedureReturn PB_Connect()
EndProcedure
If PB_Connect() = #True
Debug #True
Debug PB_RestartCompiler()
EndIf
Last edited by Progi1984 on Sat Nov 22, 2008 5:45 pm, edited 1 time in total.