James Posted May 7, 2007 Share Posted May 7, 2007 (edited) Howdy,My friend wanted a time converter between: Milliseconds, seconds and minutes so he could program Sleep fucntions etc on the fly.For some reason once I had made it he said he wanted the Google logo on it so as the kind, gentle, young caring man I am, I did it for him expandcollapse popup#include <GUIConstants.au3> _GetImage() $sGui = GUICreate("Time Conversion", 462, 100, -1, -1) GUISetBkColor (0xFFFFFF) $Google = GUICtrlCreatePic("C:\temp.gif", 0, 0,0,0) $MilliSecs = GUICtrlCreateInput("MilliSeconds", 32, 8, 169, 21) $Seconds = GUICtrlCreateInput("Seconds", 32, 40, 169, 21) $Mins = GuiCtrlCreateInput("Corrected Seconds", 32, 70, 169, 21) $Convert = GUICtrlCreateButton("Convert", 216, 8, 73, 25, 0) $Clear = GUICtrlCreateButton("Clear", 376, 8, 73, 25, 0) $Exit = GUICtrlCreateButton("Exit", 296, 8, 73, 25, 0) GUISetState(@SW_SHOW, $sGui) GUISetState(@SW_DISABLE, $Google) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Exit Exit Case $Convert _Convert() Case $Clear GuiCtrlSetData($MilliSecs, "") GUICtrlSetData($Seconds, "") GuiCtrlSetData($Mins, "") EndSwitch WEnd Func _Convert() $Milli = GuiCtrlRead($Millisecs) $Secs = GuiCtrlRead($Seconds) GuiCtrlSetData($Seconds, $Milli * 0.001) GuiCtrlSetData($Mins, $Milli * 0.000016666666666666667) EndFunc Func _GetImage() If FileExists("C:\temp.gif") Then ; Else InetGet("http://www.google.co.uk/intl/en_uk/images/logo.gif", "C:\temp.gif", 1) EndIf EndFuncSo, I thought I would post it here for some other person who wants to convert it on the fly.SecureEdit: Some random problem with uploading the code Edited May 7, 2007 by Secure_ICT Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Pascal257 Posted May 7, 2007 Share Posted May 7, 2007 I think thats doubled: Exit Case $Convert _Convert() Case $Clear GuiCtrlSetData($MilliSecs, "") GUICtrlSetData($Seconds, "") GuiCtrlSetData($Mins, "") EndSwitch WEnd Func _Convert() $Milli = GuiCtrlRead($Millisecs) $Secs = GuiCtrlRead($Seconds) GuiCtrlSetData($Seconds, $Milli * 0.001) GuiCtrlSetData($Mins, $Milli * 0.000016666666666666667) EndFunc Link to comment Share on other sites More sharing options...
James Posted May 7, 2007 Author Share Posted May 7, 2007 ? I dont see whats doubled? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
SkinnyWhiteGuy Posted May 7, 2007 Share Posted May 7, 2007 I think he means in the _GetImage() function, it all of a sudden tries to check for cases just like it does in your While loop at the beginning of the script, while it probably should just be removed. Even your line to end that function ends with EndFuncExit, like something messed up posting it. Link to comment Share on other sites More sharing options...
James Posted May 7, 2007 Author Share Posted May 7, 2007 I see. My script is not like that.. So it must be from posting it??? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ 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