k1die Posted April 12, 2011 Share Posted April 12, 2011 Ok i have a little problem, i made this: $vot = 0 $x = inputbox("aaa" , "bbb") $y = InputBox("aaa" , "bbb") $z = abs($x - $y) Select Case($x < $y) $vot = $x Case Else $vot = $y EndSelect msgbox(0,"aaa","x=" & $x & "y=" & $y & "z=" & $z & "vot=" & $vot). I need the lower value between xy, and the difference between them. The script works with some numbers but with other numbers not. I would be so glad if i found out why examples: $x = 1000 $y = 4000 it tells me that $vot = 1000 which is correct but if i insert $x = 104 $y = 24 it tells me that $vot = 104 :| Link to comment Share on other sites More sharing options...
smartee Posted April 12, 2011 Share Posted April 12, 2011 Just out of curiousity why did you make three threads? Link to comment Share on other sites More sharing options...
smartee Posted April 12, 2011 Share Posted April 12, 2011 (edited) try this:$phrases = StringSplit("less than|greater than|equal to", "|", 2) $phrase = $phrases[0] $x = InputBox(@ScriptName, "Enter number x") $y = InputBox(@ScriptName, "Enter number y") $diff = $y - $x If ($y < $x) Then $phrase = $phrases[1] $diff = $x - $y ElseIf ($y = $x) Then $phrase = $phrases[2] EndIf MsgBox(64, @ScriptName, "x(" & $x & ") is " & $phrase & " y(" & $y & "). Difference is " & $diff) Edit: Wow, the 104,24 data screws this up too, hmm, what am i doing wrong.. Edited April 12, 2011 by smartee Link to comment Share on other sites More sharing options...
andrei0x309 Posted April 12, 2011 Share Posted April 12, 2011 Cause the interpreter dose not know that x and y are numbers . $vot = 0 $x = Number(inputbox("aaa" , "bbb")) $y = Number(InputBox("aaa" , "bbb")) $z = abs($x - $y) Select Case($x < $y) $vot = $x Case Else $vot = $y EndSelect msgbox(0,"aaa","x=" & $x & "y=" & $y & "z=" & $z & "vot=" & $vot) Link to comment Share on other sites More sharing options...
smartee Posted April 12, 2011 Share Posted April 12, 2011 how did i miss that you are absolutely right. Link to comment Share on other sites More sharing options...
k1die Posted April 12, 2011 Author Share Posted April 12, 2011 Cause the interpreter dose not know that x and y are numbers . You gave me a brilliant idea , i added $x+0 < $y+0 and it works just fine. Thanks all for reply, i`ll go back to work , newbie doing stuff... take cover something might blow up Sry for triple posting, really tired screwed up a bit. 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