idusy Posted July 7, 2007 Share Posted July 7, 2007 (edited) $GUI=GUICreate("",170,85) GUISetState() GUICtrlCreateLabel("Input function to execute.",25,5) $Input=GUICtrlCreateInput("",30,25,100) $Execute=GUICtrlCreateButton("Execute",60,50) While 1 $Msg=GUIGetMsg() $InputRead=GUICtrlRead($Input) If $msg = -3 Then Exit If $msg = $Execute Then Execute($InputRead) If @error Then MsgBox(0,"Error","Function could not be executed.",1) WEnd That pops up a GUI with an input box, you input a function and press Execute, it will run the function. It works for some function, like Beep() and MouseMove(), but doesn't work for others. I though at first it was an issue with quotations, but then I tried Shutdown(64), and that returned with an error as well. Anyone know what could possibly be causing this? Edited July 7, 2007 by idusy Link to comment Share on other sites More sharing options...
idusy Posted July 7, 2007 Author Share Posted July 7, 2007 I hate bumping, but I really would like to know the answer to this Link to comment Share on other sites More sharing options...
Valuater Posted July 7, 2007 Share Posted July 7, 2007 per help Environment, Files, Dir, Disk, GUI, InputBox, MsgBox, Misc, Network, Obj/COM, Process, Registry, Tray, WinKill functions implying deletion or modification will not be executed. They will set @error to 9999 and return "". $GUI=GUICreate("",170,85) GUISetState() GUICtrlCreateLabel("Input function to execute.",25,5) $Input=GUICtrlCreateInput("",30,25,100) $Execute=GUICtrlCreateButton("Execute",60,50) While 1 $Msg=GUIGetMsg() $InputRead=GUICtrlRead($Input) If $msg = -3 Then Exit If $msg = $Execute Then Execute($InputRead) If @error Then MsgBox(0,"Error","Function could not be executed. #" & @error,3) WEnd now test with this and you will see the error set to 9999 8) Link to comment Share on other sites More sharing options...
idusy Posted July 7, 2007 Author Share Posted July 7, 2007 (edited) per help $GUI=GUICreate("",170,85) GUISetState() GUICtrlCreateLabel("Input function to execute.",25,5) $Input=GUICtrlCreateInput("",30,25,100) $Execute=GUICtrlCreateButton("Execute",60,50) While 1 $Msg=GUIGetMsg() $InputRead=GUICtrlRead($Input) If $msg = -3 Then Exit If $msg = $Execute Then Execute($InputRead) If @error Then MsgBox(0,"Error","Function could not be executed. #" & @error,3) WEnd now test with this and you will see the error set to 9999 8) Bleh, I even read that before and it didn't sink in... Well, that makes much more sense now. Thanks. Edited July 7, 2007 by idusy Link to comment Share on other sites More sharing options...
Valuater Posted July 7, 2007 Share Posted July 7, 2007 Welcome 8) 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