igmeou 0 Posted March 14, 2005 Hi, Is there a way for me to use inputbox function to get number instead of string? Func askNumber($question) $answer = InputBox ("Please answer the question", $question);can use for string only ;Return 0 for invalid input and not a number If @error > 0 Then Return 0 EndIf Return GUICtrlRead ($answer) EndFunc I need the code above to ask a user to input a number and then return it to the main function. Oh and I'm using onEvent mode for this program. Anyone please? [font="Arial"]Thanks[/font]If @error = me Then $sorry Else Do $clarifyMe Until $meClear EndIF MsgBox(0,"Special Message!","Special Thanks to " & $allHadReplied,$Forever) Share this post Link to post Share on other sites
CyberSlug 6 Posted March 14, 2005 ; force result to be treated like a number $answer = Number($answer) Be sure to do that AFTER you check the @error value of InputBox Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Share this post Link to post Share on other sites
igmeou 0 Posted March 14, 2005 (edited) Thanks slug. I works now! Thanks! Actually I had try Return Number(GUICtrlRead ($answer)) but this don't work. Any reason for this?? Ok. Now I finally release my mistake. I trying to get the controlID instead of the data. Edited March 14, 2005 by igmeou [font="Arial"]Thanks[/font]If @error = me Then $sorry Else Do $clarifyMe Until $meClear EndIF MsgBox(0,"Special Message!","Special Thanks to " & $allHadReplied,$Forever) Share this post Link to post Share on other sites