RobertKipling Posted April 15, 2009 Share Posted April 15, 2009 Long story short, I'm trying to write an advanced command prompt. Some of the programs will be launched from the GUI I created (which resembles the DOS prompt), and some of them will be user-interactive, with their output streamed into a text box and the input taken from either the keyboard or another text box below it. The problem is, when I got the program to interact, output-only functions like "dir" worked perfectly, but other ones, like "prompt" which required input, would freeze the program and really mess up the processor. Any suggestions? $foo = Run(@ComSpec & " /c " & $data, $currentdir, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) do ;; run While 1 $line = StdoutRead($foo) If @error Then ExitLoop if $line <> "" Then GUICtrlSetData($txtMain, $line, "add") ;MsgBox(0, "STDOUT read:", $line) Wend if not WinExists($foo) then ExitLoop do $msg = GUIGetMsg() until $msg = $button1 MsgBox(0,"","Writing OUT") StdinWrite($foo, GUICtrlRead($txtPrompt)& @CRLF) StdinWrite($foo) until not WinExists($foo) Link to comment Share on other sites More sharing options...
martin Posted April 15, 2009 Share Posted April 15, 2009 Can you show some code we can run to see the problem? Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
RobertKipling Posted April 15, 2009 Author Share Posted April 15, 2009 Here's the source code for the project; sorry I didn't include it earlier but it's a lot of content.prompt.zip Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now