Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
is it possible to capture the standard output while running tools/compilers in such a way that the output is displayed in the window of the running tool as well as captured for summary in Zeus?
At the moment I'm testing Zeus with some python scripts I use to compile my sources and assets (Python creates some kind of ANT and other build scripts and executes additional tools for the final build) which for some projects takes quite some time and creates a lot of informational output while running. Now I'd like to see the build running (if only just to see everything's still ok) but after the build I'd like to have the output in Zeus in case there were compiletime errors and the like.
I hope thats doable because I really start to like Zeus but that's a feature I cannot live without
is it possible to capture the standard output while running tools/compilers in such a way that the output is displayed in the window of the running tool as well as captured for summary in Zeus?
I think using something like tee will enable you to achive this result. For example assume we have a test.cmd batch file to simulate a script requiring user input:
function key_macro()
-- the batch command line which uses tee to capture the output to a file
local cmd = "test.cmd | tee output.txt"
-- run the command using a DOS window and wait for it to finish
local flags = 16+32+64
-- batch file is assumed to be c:\temp\test.cmd
local dir = "c:\\temp"
-- run command which should display a DOS window
system(cmd, dir, flags)
-- when the command ends send the output file to zeus
flags = 2+16+32
system("type output.txt", dir, flags)
end
key_macro() -- run the macro
it is possible to run the batch file in a DOS window and wait for the user input and then capture the output produced into a Zeus tool window.
Cheers Jussi
Last edited by jussij on Sun Jan 31, 2010 11:25 pm, edited 2 times in total.
is it possible to move the cursor (and the view) to the last (or any other) line if it is the output window, e.g. the one the logfile is written to, using system( "type"... )?
Seems like putting a set_line_pos after the system call doesn't work.
Unfortunately this appears to a timing, messaging or design related bug
The system macro function will start the program running and then create a background thread to monitor the program output. It then waits for the program to end. When the program ends the system macro function returns to the script with the process exit code.
But even though the program has ended the thread has not. The thread still has to manage the captured output and create the tool output window. So it is only some time later that the thread finish and the tool window appears.
To make things worse, I think windows is blocking the thread because any number of calls to the yield macro function will not see the thread end and the tool window appear. I think the tool window only appears after the script has ended at whcih time Windows unblocks the waiting thread
function key_macro()
-- the batch command line which uses tee to capture the output to a file
local cmd = "test.cmd | tee output.txt"
-- run the command using a DOS window and wait for it to finish
local flags = 16+32+64
-- batch file is assumed to be c:\temp\test.cmd
local dir = "c:\\temp"
-- run command which should display a DOS window
system(cmd, dir, flags)
-- send the output to a Zeus compiler window
file_open_compiler("c:\\temp\\output.txt","My Compiler")
end
key_macro() -- run the macro