#91084 - 2003-01-16 11:49 PM
Re: Shawn - Capture Console Output in KixForms?
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Eddie -
Think I know exactly what your talking about and I have even researched this. In fact, even before kixforms was born, this idea of yours was the very first one i tried.
Correct me if im wrong, but what your suggesting is to "wrap" the kixscript in a virtual DOS console - instead of that bland old (real) DOS console. And to the script itself, it would be totally transparent. And when the script writes to the console using ?'s and ""'s - the output would go to the fancy GUI console (wrapper) instead of the real one. And maybe on "the side" of this console you could have special buttons that did neat things.
Believe me when I say that all this is possible, in fact its almost an ideal way to work this whole GUI script thing. There are even some freeware utilities available on the net that can do this. But heres the big problem - these wrappers only work with programs that read and write their output to stdout and stdin. In other words - well behaved DOS utilities. They work by intercepting or hooking-into the input and output streams.
Unfortunately (and I know this for a fact) Kixtart does NOT use these standard mechanisms. Kixtart writes directly to the DOS console using the Windows Console API's. That this is how it is able to support all those fancy cursor positioning (AT) and COLOR commands. It's also evidenced by the fact that Kixtart cant handle (support) redirection or stdin and stdout on the command line.
I've even gone so far as to try running Kixtart under one of these wrappers but with absolutely zero luck Great suggestion though and maybe someone else on the board has heard of something that may work with Kixtart. [ 16. January 2003, 23:53: Message edited by: Shawn ]
|
|
Top
|
|
|
|
#91085 - 2003-01-17 12:13 AM
Re: Shawn - Capture Console Output in KixForms?
|
kholm
Korg Regular
   
Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
|
Shawn,
One challenge more!
You would also need some way of capturing StdErr in your wrapper.
Messages from ie. the Net command are reported via stderr to the console. Even sucess messages
-Erik
|
|
Top
|
|
|
|
#91089 - 2003-01-17 02:40 AM
Re: Shawn - Capture Console Output in KixForms?
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Guys,
Heres an example of a console wrapper that implements stdout redirection - sadly it also demonstrates that Kixtart isn't a very good candidate for this - but it does work with most other DOS utilities:
Console Output Redirection Demo (Wrapper)
No I didn't write this.
To use it - start the demo then in the command box type:
cmd /c dir *.*
then ENTER ... should see the results. Then try this command:
kix32 /?
should see that kix32 writes its usage using stdout ? ... then might try running a script that performs some output ...
kix32 c:\test.kix
curious to see if anyone gets any output generated with this ...
-Shawn
|
|
Top
|
|
|
|
#91095 - 2003-04-08 02:24 PM
Re: Shawn - Capture Console Output in KixForms?
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Hmm. I have a kludge which will allow you to get close, but it is not very pretty.
I knocked up a console screen dump utility a little while ago. If the output from the commands are short enough, you can go through a process of: 1) Clear screen 2) Run command 3) Dump screen 4) Display in GUI
The screen dump utility copies the information directly from the console, so redirection isn't a problem, however you do need a console
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 1003 anonymous users online.
|
|
|