James Posted August 1, 2007 Author Share Posted August 1, 2007 I can do better. I will PM you the script. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
mikehunt114 Posted August 1, 2007 Share Posted August 1, 2007 It's actually better to have a reproducer. Then I don't have to sort through all the code to find the issue. As well, I find that the majority of the time I start making a reproducer, I discover the problem myself. Anyways, I think you'll find the solution to your problem pretty easy: Func RealTime() $ToMakeRead = GuiCtrlRead($ToMake) $MathRead = GuiCtrlRead($NumberEntry) ;For $i = 1 to $MathRead $ToMakeRead -= $MathRead GuiCtrlSetData($ToMake, $ToMakeRead) ;Next ;nGuiCtrlSetData($ToMake, Execute(GuiCtrlRead($ToMake)) - Execute(GuiCtrlRead($NumberEntry))) ;Local $OldStr ;If $ToMakeRead <> $OldStr Then ;GuiCtrlSetData($ToMake, $ToMakeRead - Execute($MathRead)) ;EndIf ;$OldStr = $MathRead EndFunc IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
James Posted August 1, 2007 Author Share Posted August 1, 2007 Well, I dont have quite enough time, but I thought you should know the problem a bit easier. That also, does not work. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
mikehunt114 Posted August 1, 2007 Share Posted August 1, 2007 That puts a number in your label, in the code you gave me, I assure you. Not much else I can do until you help me help you... IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
James Posted August 1, 2007 Author Share Posted August 1, 2007 OK, well I need the label to basically change. Lets say, I need to make 50. Inside the input box, I put 5*5. The label will then change from 50 to 50 - 5*5. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
mikehunt114 Posted August 1, 2007 Share Posted August 1, 2007 Are you trying to dynamically change the label text as the user types in the input box? IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
James Posted August 1, 2007 Author Share Posted August 1, 2007 Yes. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
mikehunt114 Posted August 1, 2007 Share Posted August 1, 2007 I know of no way to do that. Search MSDN for messages from an input control, and see if there is a message sent when you edit the input. IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
mikehunt114 Posted August 1, 2007 Share Posted August 1, 2007 On second thought, you could use AdlibEnable, or possibly poll the input in your GUI loop. Example: #include <GUIConstants.au3> AdlibEnable("Update") Opt("GUIOnEventMode", 1) HotKeySet("{Esc}","Quit") $testGUI = GUICreate("Dynamic Label Updater", 400, 400) GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") $input = GUICtrlCreateInput("", 10, 10, 100, 25) $label = GUICtrlCreateLabel("", 50, 100, 100, 25) GUISetState(@SW_SHOW, $testGUI) While 1 Sleep(10) WEnd Func Update() $text = GUICtrlRead($input) GUICtrlSetData($label, $text) EndFunc Func Quit() Exit 0 EndFunc Let's have a look at yours... IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
mikehunt114 Posted August 1, 2007 Share Posted August 1, 2007 Try: expandcollapse popupFunc RealTime() $ToMakeRead = GUICtrlRead($ToMake) ConsoleWrite("$ToMakeRead: " & $ToMakeRead & @CR) $MathRead = GUICtrlRead($NumberEntry) ConsoleWrite("$MathRead: " & $MathRead & @CR) If $MathRead <> $CTRLRead And StringLen($MathRead) > 1 Then ;MsgBox(0, "", "Different") $ToMakeRead -= Execute($MathRead) ConsoleWrite("$ToMakeRead: " & $ToMakeRead & @CR) GUICtrlSetData($ToMake, $ToMakeRead) EndIf EndFunc ;==>RealTimeoÝ÷ Ùh^쨺µ¡W¥¢ky§l)¶¬jëh×6While 1 Global $CTRLRead = GUICtrlRead($NumberEntry) _CheckInput() $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE, $Exit Exit Case $Start, $StartGame $Random = Random(0, UBound($N2M) - 1, 1) $Result = $N2M[$Random] GUICtrlSetData($ToMake, $Result, "") Case $Check Math() Case $NumberEntry Math() ;Realtime() Case $About MsgBox(4096, "About", "St*r Numbers Game" & @CRLF & @TAB & "Copyright James Brooks 2007!" & @CRLF & @CRLF _ & "Concept by: James Brooks" & @CRLF & "Graphics by: James Brooks" & @CRLF & "Designed by: James Brooks" & _ @CRLF & "Version: " & $version) Case $Update Updater() Case $HelpMe MsgBox(0, "St*r Numbers Game", "Try and make the number shown in blue by using only the numbers shown in the star" & _ "You can use +-*/ to make the number!") Case $Website ShellExecute("http://starnumbergame.googlepages.com/home") EndSwitch RealTime() WEnd IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
mikehunt114 Posted August 1, 2007 Share Posted August 1, 2007 (edited) Actually, better add this instead:Func Start() $Random = Random(0, UBound($N2M) - 1, 1) Global $Result = $N2M[$Random] GUICtrlSetData($ToMake, $Result, "") EndFunc ;==>Start Func RealTime() $MathRead = GUICtrlRead($NumberEntry) If $MathRead <> $CTRLRead And StringLen($MathRead) > 1 Then $value = $Result - Execute($MathRead) GUICtrlSetData($ToMake, $value) EndIf EndFunc ;==>RealTimeEdit: typos Edited August 1, 2007 by mikehunt114 IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
James Posted August 2, 2007 Author Share Posted August 2, 2007 Fantastic! You are great! Thankyou sooo much! I will need to add you in the credits! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
James Posted August 2, 2007 Author Share Posted August 2, 2007 I just realised I had to change the Math Func to check whether or not the number to make = 0. This way it works correctly. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
mikehunt114 Posted August 2, 2007 Share Posted August 2, 2007 Cheers. IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] 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