Console output
BlitzMax Forums/BlitzMax Programming/Console output
| ||
Can i use from an external program that runs in the Terminal (MacOS X) the Textoutput, Status Info etc. in my own Blitzmax GUI like this: avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.00s avrdude: Device signature = 0x1e9702 avrdude: current erase-rewrite cycle count is 1 (if being tracked) avrdude: reading flash memory: Reading | ################# | 33% 9.25s or not? |
| ||
Erm, yes? Look at the various pipes that are contained in the TProcess object. |
| ||
Where can i find the TProcess object? I can't fin anything in the Blitzmax manual. |
| ||
Has anybody a sample? |
| ||
If memory serves me then the TProcess stuff is in the public source folder below all the documentation (in normal IDE). One of the problems that i can see you having is setting the cursor to overwrite the progress bar when theres an update. I havent seen a way to do this yet but with a bit of web searching you should be able to find it. Im sorry but I dont think I fully understand the details of your question but I hope that I helped anyway :) |
| ||
this is a small function from a 'ModuleManager' I'm currently writing (to get my head a bit free from minib3d) Maybe this will help you. |
| ||
Yes, this is the beginning. I hope it will be not to late this night. |
| ||
This Part is done. Work's great with the code examples from klepto2. I have now another question to all. Is it possible to make a incbin with an external programm and can i start it from my blitzmax main program. My idea is now to use the terminal execution in my blitmax main and start it so that i have only one program file? |
| ||
Short and simply : with some restrictions yes: I have written a sample app for something like this to provide extended error info for apps (mainly usage in betas) here is a sample: http://www.blitzforum.de/upload/file.php?id=518 the main program is the test.bmx and have to be compiled at first (in this case with debug enabled) after this you compile the exdebugger.bmx. (release mode) Now simply execute exdebugger.exe and you will see the result. The trick behind this is to temporaly recreate the test.debug.exe by copying the bin data from the incbin stream to the HD and create a process attached to this temp.exe. |
| ||
Interesting! It is possible to do the following?: There are 1 master and 3 slaves. I wan't that the master can start the 3 slaves as processes(CreateProcess) and communicate(read and write data from/to slave) But the slaves may not wait for any input(so, there is no way I think with Input command) and the master too. So I need a function, to check, if there are StdIn stuff available. I hope you have an idea :) cu olli |
| ||
I have tested another form to start an external programm under MacOS X. I copied the file directly into to the applicationdir that is shown in contextmenu "Show Package". And it work's. |
| ||
I used this program part for my GUI project. It shows me all info's about the external program. But it has a counter that show's me the percent of the program status, but i get this errormassage from BlitzMax: PipeStream ReadBuffer Overflow Process complete In the c-source it print out the following: if (last == 0) { fprintf(stderr, "\r%s %d%% %0.2fs ", header, percent, etime); } This is the code i use in Blitzmax: While Process.Status() PollSystem If Process.pipe.ReadAvail() Then line = Process.pipe.ReadLine() If line <> "" Then AddTextAreaText(textarea , line+Chr$(13)) FormatTextAreaText(textarea,10,230,460,70,lines,1,TEXTAREA_LINES) lines=lines+1 EndIf EndIf If Process.err.ReadAvail() Then line = Process.err.ReadLine() If Line <> "" Then AddTextAreaText(textarea , line+Chr$(13)) FormatTextAreaText(textarea,10,230,460,70,lines,1,TEXTAREA_LINES) Lines=lines+1 EndIf EndIf Wend |