au3scr Posted March 8, 2008 Share Posted March 8, 2008 Why shis script starts with errors? expandcollapse popup#include <GUIConstants.au3> #include <GUIEdit.au3> $Form1 = GUICreate(@WorkingDir, 554, 276, 108, 120) $Prompt = GUICtrlCreateEdit(@WorkingDir & ">", 0, 0, 551, 275, BitOR($WS_HSCROLL,$WS_VSCROLL)) GUICtrlSetFont(-1, 11, 400, 0, "Terminal") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, 0x000000) $Button1 = GUICtrlCreateButton("Button1", 478, 246, 53, 11, $BS_DEFPUSHBUTTON) GUICtrlSetState(-1, $GUI_HIDE) GUISetState(@SW_SHOW) Run(@ComSpec, "", @SW_HIDE,2) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $LineN=_GUICtrlEdit_GetLineCount($Prompt)-1 $RawComm= _GUICtrlEdit_GetLine ($Prompt,$LineN) $Command=StringSplit($RawComm,">",1) If $Command[0]<>2 Then _GUICtrlEdit_AppendText($Prompt,@CRLF & @WorkingDir & ">") ControlFocus($Form1,"",$Prompt) Else If $Command[2]="exit" Then Exit $sRet = Run(@ComSpec & " /c "& $Command[2], "", @SW_HIDE,2) While 1 $line = StdoutRead($sRet,71) If @error Then ExitLoop _GUICtrlEdit_AppendText($Prompt,@CRLF & $line) Wend _GUICtrlEdit_AppendText($Prompt,@CRLF & @WorkingDir & ">") ControlFocus($Form1,"",$Prompt) EndIf EndSwitch WEnd Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 9, 2008 Share Posted March 9, 2008 Why shis script starts with errors? expandcollapse popup#include <GUIConstants.au3> #include <GUIEdit.au3> $Form1 = GUICreate(@WorkingDir, 554, 276, 108, 120) $Prompt = GUICtrlCreateEdit(@WorkingDir & ">", 0, 0, 551, 275, BitOR($WS_HSCROLL,$WS_VSCROLL)) GUICtrlSetFont(-1, 11, 400, 0, "Terminal") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, 0x000000) $Button1 = GUICtrlCreateButton("Button1", 478, 246, 53, 11, $BS_DEFPUSHBUTTON) GUICtrlSetState(-1, $GUI_HIDE) GUISetState(@SW_SHOW) Run(@ComSpec, "", @SW_HIDE,2) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $LineN=_GUICtrlEdit_GetLineCount($Prompt)-1 $RawComm= _GUICtrlEdit_GetLine ($Prompt,$LineN) $Command=StringSplit($RawComm,">",1) If $Command[0]<>2 Then _GUICtrlEdit_AppendText($Prompt,@CRLF & @WorkingDir & ">") ControlFocus($Form1,"",$Prompt) Else If $Command[2]="exit" Then Exit $sRet = Run(@ComSpec & " /c "& $Command[2], "", @SW_HIDE,2) While 1 $line = StdoutRead($sRet,71) If @error Then ExitLoop _GUICtrlEdit_AppendText($Prompt,@CRLF & $line) Wend _GUICtrlEdit_AppendText($Prompt,@CRLF & @WorkingDir & ">") ControlFocus($Form1,"",$Prompt) EndIf EndSwitch WEnd ...but only if compiled/run with Beta. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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