Jump to content
Sign in to follow this  
igmeou

Need help

Recommended Posts

igmeou

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
igmeou

:D Thanks slug. I works now! Thanks!

Actually I had try

Return Number(GUICtrlRead ($answer))
but this don't work. Any reason for this?? :D

:) Ok. Now I finally release my mistake. :huh:

I trying to get the controlID instead of the data.

Edited 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×