layer Posted January 25, 2005 Posted January 25, 2005 (edited) hey, i was wondering, what is wrong with this? :"> doesn't seem to be anything wrong..Func Clear () GUICtrlDelete ($char) $char= GUICtrlCreateInput ("# of characters outputted", 10, 20, 140) GUICtrlSetState ($char, $GUI_FOCUS) EndFuncany help will be appreciated!! thanks! EDIT: lets just say $char is defined already... before i create the new one Edited January 25, 2005 by layer FootbaG
CyberSlug Posted January 26, 2005 Posted January 26, 2005 Why are you deleting and re-creating the actual control? GuiCtrlSetData($char, "# of characters outputted") GUICtrlSetState ($char, $GUI_FOCUS) Also, what do you mean by "what's wrong": Does your code crash, loop infinitely, not do what you expect? Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
layer Posted January 26, 2005 Author Posted January 26, 2005 i mean, it doesnt do anything... well, i could use your method... but even that doesnt work, a bug or what? whne i say it doesnt do anything, i mean, it doest reset the data heres the full code.. expandcollapse popup#include <GUIConstants.au3> GUICreate ("Random Generator", 200, 100) $char= GUICtrlCreateInput ("# of characters outputted", 10, 20, 140) $make= GUICtrlCreatebutton ("Make", 10, 60) $pw= GUICtrlCreateEdit ("", 70, 63.5, 125, 20, $ES_READONLY) GUICtrlCreateLabel ("Output:", 135, 40) GUISetState () GUICtrlSetState ($char, $GUI_FOCUS) $clear= GUICtrlCreateButton ("Clear", 155, 15) While 1 $get= GUIGetMsg () If $get= $make then Generate () If $get= $clear Then Clear () EndIf EndIf If $get= -3 then Exit WEnd Func Generate () $read= GUICtrlRead ($char) If NOT StringIsDigit($read) Then Return $read= Number($read) GuictrlSetData ($pw, "") GUICtrlSetLimit ($pw, $read) For $i = 1 To $read $pass= Chr(Random(Asc("a"), Asc("z"), 1)) GuictrlSetData ($pw, $pass, 1) GUICtrlSetData ($pw, Random (0, 9, 1), 1) Next EndFunc Func Clear () GuiCtrlSetData($char, "# of characters outputted") GUICtrlSetState ($char, $GUI_FOCUS) EndFunc FootbaG
CyberSlug Posted January 26, 2005 Posted January 26, 2005 There's your problem. If $get= $make then Generate () If $get= $clear Then Clear () EndIf EndIf I'm too lazy to do the full select-case or if-then-else:While 1 $get= GUIGetMsg () If $get= $make Then Generate () If $get= $clear Then Clear () If $get= -3 then Exit WEnd Learn to use MsgBox(4096,"debug", "This is called from the Clear function... testing 1 2 3") Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
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