Nuffilein805 Posted November 8, 2005 Share Posted November 8, 2005 ok, i just discovered a little problem using inputboxes (i know its old-fashioned, but i wanted to make a simple program to compare 2 user input values {numbers only}) here's what i did: $i1 = InputBox ("#1", "Please give a number", 10) $i2 = InputBox ("#2", "Please give a number", 9) if $i1 > $i2 Then $max = $i1 $min = $i2 ElseIf $i1 = $i2 Then $max = $i1 $min = $i1 elseif $i2 > $i1 Then $max = $i2 $min = $i1 EndIf msgbox (0, "Test", "Higher value: " & $max & @cr & "Lower value: " & $min) i know how to fix it for me, but i just thought, that you might want to know (and see) my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
GaryFrost Posted November 8, 2005 Share Posted November 8, 2005 currently your comparing strings cast it to int $i1 = Int(InputBox ("#1", "Please give a number", 10)) $i2 = Int(InputBox ("#2", "Please give a number", 9)) if $i1 > $i2 Then $max = $i1 $min = $i2 ElseIf $i1 = $i2 Then $max = $i1 $min = $i1 elseif $i2 > $i1 Then $max = $i2 $min = $i1 EndIf msgbox (0, "Test", "Higher value: " & $max & @cr & "Lower value: " & $min) 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...
Nuffilein805 Posted November 8, 2005 Author Share Posted November 8, 2005 i said i knew how to fix but there is still 1 problem if i'm using floating numbers int(string) won't work any suggestions but its funny to look at, have you tried it out? my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
GaryFrost Posted November 8, 2005 Share Posted November 8, 2005 $i1 = Number(InputBox ("#1", "Please give a number", 10)) $i2 = Number(InputBox ("#2", "Please give a number", 9)) if $i1 > $i2 Then $max = $i1 $min = $i2 ElseIf $i1 = $i2 Then $max = $i1 $min = $i1 elseif $i2 > $i1 Then $max = $i2 $min = $i1 EndIf msgbox (0, "Test", "Higher value: " & $max & @cr & "Lower value: " & $min) 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...
Nuffilein805 Posted November 8, 2005 Author Share Posted November 8, 2005 hey, thx thats great why haven't i found this 1? damn can some1 maybe move this to v3support (now we all know its not a bug) my little chatmy little encryption toolmy little hidermy unsafe clickbot 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