Valuater Posted September 29, 2005 Share Posted September 29, 2005 (edited) I have this $updown3 = GUICtrlCreateUpdown($T_Min, $UDS_HORZ + $UDS_ARROWKEYS) GUICtrlSetLimit ( $updown3, 10, 1) problem is it represents the numbers as 1 2 3 4 5 6 7 8 9 10 i need the numbers to be 01 02 03 04 05 06 07 08 09 10 couldn't find the needed info.... any help is appreciated EDIT OR... maybe i can set it as 01 then update the control ???? 8) Edited September 29, 2005 by Valuater Link to comment Share on other sites More sharing options...
Confuzzled Posted September 29, 2005 Share Posted September 29, 2005 Does StringFormat help? You may need to convert your numeric values to strings. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 29, 2005 Moderators Share Posted September 29, 2005 lol, this gave me a headache!! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
BigDod Posted September 29, 2005 Share Posted September 29, 2005 If you converted your numbers to strings and somehow counted the characters in the string you could add a 0 at the front of any with just one charactar (ie 1-9) Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
this-is-me Posted September 29, 2005 Share Posted September 29, 2005 $num = 5 if($num < 10) then $num = "0" & $num Who else would I be? Link to comment Share on other sites More sharing options...
ligenza Posted September 29, 2005 Share Posted September 29, 2005 I have this$updown3 = GUICtrlCreateUpdown($T_Min, $UDS_HORZ + $UDS_ARROWKEYS) GUICtrlSetLimit ( $updown3, 10, 1)problem is it represents the numbers as12345678910i need the numbers to be01020304050607080910couldn't find the needed info.... any help is appreciatedEDITOR... maybe i can set it as 01 then update the control ????8)Here is the code you need:CODE#include "GUIConstants.au3"$title = "!"GUICreate($title,-1,-1,-1,-1, $WS_SIZEBOX)$input = GUICtrlCreateInput ("01",10,10, 50, 20)$updown = GUICtrlCreateUpdown($input)GUICtrlSetLimit ( $updown, 10, 1)GUISetState ()While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit If $msg = $updown Then $d = GUICtrlRead($input) If ($d <= 9) And ($d >= 2) Then $d = "0" & $d GUICtrlSetData ( $input, $d) ElseIf $d = 1 Then $d = "01" GUICtrlSetData ( $input, $d) EndIf EndIfWEnd Link to comment Share on other sites More sharing options...
Developers Jos Posted September 29, 2005 Developers Share Posted September 29, 2005 Does StringFormat help? You may need to convert your numeric values to strings.the StringFormat way:$a=StringFormat("%02d",$a) SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ligenza Posted September 29, 2005 Share Posted September 29, 2005 (edited) $a = 1$a = StringRight("0" & $a,2)MsgBox(4096,"",$a);Lar.That works ok for two characters, my solution will work even if the numbers are expanded upon later. The string format function looks interesting, I'll have to play with it a bit.Ok. String format is very nice except look at this bug..CODE#include "GUIConstants.au3"$title = "!"GUICreate($title,-1,-1,-1,-1, $WS_SIZEBOX)$input = GUICtrlCreateInput ("01",10,10, 50, 20)$updown = GUICtrlCreateUpdown($input)GUICtrlSetLimit ( $updown, 1000, 1)GUISetState ()While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit If $msg = $updown Then$txt = GUICtrlRead($input)$a=StringFormat("%02d",$txt) GUICtrlSetData ( $input, $a) EndIf WEndWhen you reach 1,000 and click up it will go back to 01. If you don't use StringFormat this will not happen. Fix please. Edited September 29, 2005 by ligenza Link to comment Share on other sites More sharing options...
GaryFrost Posted September 29, 2005 Share Posted September 29, 2005 CODE #include "GUIConstants.au3" $title = "!" GUICreate($title, -1, -1, -1, -1, $WS_SIZEBOX) $input = GUICtrlCreateInput("01", 10, 10, 50, 20) $updown = GUICtrlCreateUpdown($input) GUICtrlSetLimit($updown, 1000, 1) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit If $msg = $updown Then GUICtrlSetData($input, StringFormat("%02d",StringReplace(GUICtrlRead($input),",",""))) WEnd SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
Valuater Posted September 29, 2005 Author Share Posted September 29, 2005 thank you... thank you ALL for your effort i am going to try all of the ideas.... but my favorite line is from mr wizzard with If $msg = $updown3 Then GUICtrlSetData($T_Min, StringFormat("%02d",StringReplace(GUICtrlRead($T_Min),",",""))) which includes JdeB's $a=StringFormat("%02d",$a) ok..... i had found my answer late last night by the "Hobbyiest" way... like this If $msg = $updown3 Then $Min_set = GUICtrlRead($T_Min) If $Min_set = 1 then GUICtrlSetData($T_Min, "01") If $Min_set = 2 then GUICtrlSetData($T_Min, "02") If $Min_set = 3 then GUICtrlSetData($T_Min, "03") If $Min_set = 4 then GUICtrlSetData($T_Min, "04") If $Min_set = 5 then GUICtrlSetData($T_Min, "05") If $Min_set = 6 then GUICtrlSetData($T_Min, "06") If $Min_set = 7 then GUICtrlSetData($T_Min, "07") If $Min_set = 8 then GUICtrlSetData($T_Min, "08") If $Min_set = 9 then GUICtrlSetData($T_Min, "09") EndIf simple... clean... but lots of lines thnaks again Link to comment Share on other sites More sharing options...
GaryFrost Posted September 29, 2005 Share Posted September 29, 2005 (edited) sorry haven't used the updown before so didn't know about this style, so here's another solution also: CODE #include "GUIConstants.au3" $title = "!" GUICreate($title, -1, -1, -1, -1, $WS_SIZEBOX) $input = GUICtrlCreateInput("01", 10, 10, 50, 20) $updown = GUICtrlCreateUpdown($input,$UDS_NOTHOUSANDS) GUICtrlSetLimit($updown, 1000, 1) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit If $msg = $updown Then GUICtrlSetData($input, StringFormat("%02d",GUICtrlRead($input))) WEnd Edited September 29, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
Valuater Posted September 29, 2005 Author Share Posted September 29, 2005 thanks gafrost.... they both worked great and thanks for this too..... _SoundGetWaveVolume()) 8) Link to comment Share on other sites More sharing options...
GaryFrost Posted September 29, 2005 Share Posted September 29, 2005 yw SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
ligenza Posted September 29, 2005 Share Posted September 29, 2005 (edited) ywCare to comment about the 1,000 glitch? Didn't think so. Edited September 29, 2005 by ligenza Link to comment Share on other sites More sharing options...
BigDod Posted September 29, 2005 Share Posted September 29, 2005 Care to comment about the 1,000 glitch? Didn't think so. Lay off gafrost he helps lots of people on this forum. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
GaryFrost Posted September 29, 2005 Share Posted September 29, 2005 not a glitch, updown control defaults to using the thousands seperator. SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
ligenza Posted September 29, 2005 Share Posted September 29, 2005 (edited) not a glitch, updown control defaults to using the thousands seperator.Your amazing ability to not comprehend what is said astounds me! The glitch I was refering to is that once at 1,000 when you incriment the value it goes to 01 and it does not do that when you don't use the format string function. I'm awaiting the fix for it. Lay off gafrost he helps lots of people on this forum.That implys that I don't which is hardly the case unlike you however. The "solution" here gay provided was merly a more refined version of what I had posted not to discredit him though, just using this as an example of why you're an idiot. Also, you idiot, if you look at gays code it's a direct copy and paste of mine with edits.. to imply I did nothing is very cruel of you. I'll be the first to admit however that the code gafrost posted here is superior to what I posted and him basing it off my little code snippit is of no consequence. Let it be said though that they are indeed just that, code snippits so they are not valid to draw assumptions from. I want to help people obtain solutions that work well. Edited September 29, 2005 by ligenza Link to comment Share on other sites More sharing options...
GaryFrost Posted September 29, 2005 Share Posted September 29, 2005 Stringformat kma SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
BigDod Posted September 29, 2005 Share Posted September 29, 2005 That implys that I don't which is hardly the case unlike you however. The "solution" here gay provided was merly a more refined version of what I had posted not to discredit him though, just using this as an example of why you're an idiot. Also, you idiot, if you look at gays code it's a direct copy and paste of mine with edits.. to imply I did nothing is very cruel of you. I'll be the first to admit however that the code gafrost posted here is superior to what I posted and him basing it off my little code snippit is of no consequence. Let it be said though that they are indeed just that, code snippits so they are not valid to draw assumptions from. I want to help people obtain solutions that work well.I never implied that you did nothing and it is not nice to call someone an idiot just cause they can't program as good as you. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
ligenza Posted September 29, 2005 Share Posted September 29, 2005 (edited) StringformatkmaYou fixed it! Thanks.$UDS_NOTHOUSANDS was what differed.I never implied that you did nothing and it is not nice to call someone an idiot just cause they can't program as good as you.Oh but it's fun and a valid retort to your comment. I didn't just say you were an idiot though I made it very clear exactly why I thought that. Edited September 29, 2005 by ligenza 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