Search the Community
Showing results for tags 'simple math test'.
-
Ok I was writing a script where variables change value and I need to find out which one is the smaller value but greater than 0. I've tried out some codes in different ways but none work ): I don't know what I'm doing wrong since it's very simple math test. Well I'm posting the diferent codes I wrote, hope to get some head ups... BTW I'm new to Autoit, scripting and things. Test 1 ;simple mathematics test to see which number is smaller but greater then zero ;whichever number is the smallest but greater than zero becomes true at the end $seven = False $ten = False $fifteen = False ;in this test $7 and $15 cannot be true unless we change the value Global $7 = 0,$10 = 10,$15 = 15 ; ; ; ;test 1 If $7 > 0 And $7 < $10 And $7 < $15 Then $seven = True If $10 > 0 and $10 < $7 and $10 < $15 Then $ten = True If $15 > 0 And $15 < $7 And $15 < $10 Then $fifteen = True ; if $seven = True Then MsgBox(0,"Notice!", "Seven is True" & @LF & "$7 is greater than 0 but smaller than $10 y $15",0) EndIf ; if $ten = True Then MsgBox(0,"Notice!", "Ten is True" & @LF & "$10 is greater than 0 but smaller than $7 y $15",0) EndIf ; if $fifteen = True Then MsgBox(0,"Notice!", "Fifteen is True" & @LF & "$15 is greater than 0 but smaller than $7 y $10",0) EndIf Test 2 ;simple mathematics test to see which number is smaller but greater then zero ;whichever number is the smallest but greater than zero becomes true at the end $seven = False $ten = False $fifteen = False ;in this test $7 and $15 cannot be true unless we change the value Global $7 = 0,$10 = 10,$15 = 15 ; ; ; ;test 2 If $7 <> 0 And $7 < $10 And $7 < $15 Then $seven = True ; If $10 <> 0 and $10 < $7 and $10 < $15 Then $ten = True ; If $15 <> 0 And $15 < $7 And $15 < $10 Then $fifteen = True ; if $seven = True Then MsgBox(0,"Notice!", "Seven is True" & @LF & "$7 is greater than 0 but smaller than $10 y $15",0) EndIf ; if $ten = True Then MsgBox(0,"Notice!", "Ten is True" & @LF & "$10 is greater than 0 but smaller than $7 y $15",0) EndIf ; if $fifteen = True Then MsgBox(0,"Notice!", "Fifteen is True" & @LF & "$15 is greater than 0 but smaller than $7 y $10",0) EndIf Test 3 ;simple mathematics test to see which number is smaller but greater then zero ;whichever number is the smallest but greater than zero becomes true at the end $seven = False $ten = False $fifteen = False ;in this test $7 and $15 cannot be true unless we change the value Global $7 = 0,$10 = 10,$15 = 15 ; ; ; ;test 3 If Not $7 = 0 And $7 < $10 And $7 < $15 Then $seven = True ; If Not $10 = 0 and $10 < $7 and $10 < $15 Then $ten = True ; If Not $15 = 0 And $15 < $7 And $15 < $10 Then $fifteen = True ; if $seven = True Then MsgBox(0,"Notice!", "Seven is True" & @LF & "$7 is greater than 0 but smaller than $10 y $15",0) EndIf ; if $ten = True Then MsgBox(0,"Notice!", "Ten is True" & @LF & "$10 is greater than 0 but smaller than $7 y $15",0) EndIf ; if $fifteen = True Then MsgBox(0,"Notice!", "Fifteen is True" & @LF & "$15 is greater than 0 but smaller than $7 y $10",0) EndIf Test 4 ;simple mathematics test to see which number is smaller but greater then zero ;whichever number is the smallest but greater than zero becomes true at the end $seven = False $ten = False $fifteen = False ;in this test $7 and $15 cannot be true unless we change the value Global $7 = 0,$10 = 10,$15 = 15 ; ; ; ;test 4 If Not $7 = 0 Then if $7 < $10 And $7 < $15 Then $seven = True EndIf ; If Not $10 = 0 Then If $10 < $7 and $10 < $15 Then $ten = True EndIf ; If Not $15 = 0 Then If $15 < $7 And $15 < $10 Then $fifteen = True EndIf ; if $seven = True Then MsgBox(0,"Notice!", "Seven is True" & @LF & "$7 is greater than 0 but smaller than $10 y $15",0) EndIf ; if $ten = True Then MsgBox(0,"Notice!", "Ten is True" & @LF & "$10 is greater than 0 but smaller than $7 y $15",0) EndIf ; if $fifteen = True Then MsgBox(0,"Notice!", "Fifteen is True" & @LF & "$15 is greater than 0 but smaller than $7 y $10",0) EndIf Test 5 ;simple mathematics test to see which number is smaller but greater then zero ;whichever number is the smallest but greater than zero becomes true at the end $seven = False $ten = False $fifteen = False ;in this test $7 and $15 cannot be true unless we change the value Global $7 = 0,$10 = 10,$15 = 15 ; ; ; ;test 5 If ($7 > 0) And ($7 < $10) And ($7 < $15) Then $seven = True If ($10 > 0) and ($10 < $7) and ($10 < $15) Then $ten = True If ($15 > 0) And ($15 < $7) And ($15 < $10) Then $fifteen = True ; if $seven = True Then MsgBox(0,"Notice!", "Seven is True" & @LF & "$7 is greater than 0 but smaller than $10 y $15",0) EndIf ; if $ten = True Then MsgBox(0,"Notice!", "Ten is True" & @LF & "$10 is greater than 0 but smaller than $7 y $15",0) EndIf ; if $fifteen = True Then MsgBox(0,"Notice!", "Fifteen is True" & @LF & "$15 is greater than 0 but smaller than $7 y $10",0) EndIf Test 6 ;simple mathematics test to see which number is smaller but greater then zero ;whichever number is the smallest but greater than zero becomes true at the end $seven = False $ten = False $fifteen = False ;in this test $7 and $15 cannot be true unless we change the value Global $7 = 0,$10 = 10,$15 = 15 ; ; ; ;test 6 If ($7 <> 0) And ($7 < $10) And ($7 < $15) Then $seven = True ; If ($10 <> 0) and ($10 < $7) and ($10 < $15) Then $ten = True ; If ($15 <> 0) And ($15 < $7) And ($15 < $10) Then $fifteen = True ; if $seven = True Then MsgBox(0,"Notice!", "Seven is True" & @LF & "$7 is greater than 0 but smaller than $10 y $15",0) EndIf ; if $ten = True Then MsgBox(0,"Notice!", "Ten is True" & @LF & "$10 is greater than 0 but smaller than $7 y $15",0) EndIf ; if $fifteen = True Then MsgBox(0,"Notice!", "Fifteen is True" & @LF & "$15 is greater than 0 but smaller than $7 y $10",0) EndIf Test 7 ;simple mathematics test to see which number is smaller but greater then zero ;whichever number is the smallest but greater than zero becomes true at the end $seven = False $ten = False $fifteen = False ;in this test $7 and $15 cannot be true unless we change the value Global $7 = 0,$10 = 10,$15 = 15 ; ; ; ;test 7 If Not ($7 = 0) And ($7 < $10) And ($7 < $15) Then $seven = True ; If Not ($10 = 0) and ($10 < $7) and ($10 < $15) Then $ten = True ; If Not ($15 = 0) And ($15 < $7) And ($15 < $10) Then $fifteen = True ; if $seven = True Then MsgBox(0,"Notice!", "Seven is True" & @LF & "$7 is greater than 0 but smaller than $10 y $15",0) EndIf ; if $ten = True Then MsgBox(0,"Notice!", "Ten is True" & @LF & "$10 is greater than 0 but smaller than $7 y $15",0) EndIf ; if $fifteen = True Then MsgBox(0,"Notice!", "Fifteen is True" & @LF & "$15 is greater than 0 but smaller than $7 y $10",0) EndIf Test 8 ;simple mathematics test to see which number is smaller but greater then zero ;whichever number is the smallest but greater than zero becomes true at the end $seven = False $ten = False $fifteen = False ;in this test $7 and $15 cannot be true unless we change the value Global $7 = 0,$10 = 10,$15 = 15 ; ; ; ;test 8 If Not $7 = 0 Then if $7 < $10 And $7 < $15 Then $seven = True EndIf ; If Not $10 = 0 Then If $10 < $7 and $10 < $15 Then $ten = True EndIf ; If Not $15 = 0 Then If $15 < $7 And $15 < $10 Then $fifteen = True EndIf ; if $seven = True Then MsgBox(0,"Notice!", "Seven is True" & @LF & "$7 is greater than 0 but smaller than $10 y $15",0) EndIf ; if $ten = True Then MsgBox(0,"Notice!", "Ten is True" & @LF & "$10 is greater than 0 but smaller than $7 y $15",0) EndIf ; if $fifteen = True Then MsgBox(0,"Notice!", "Fifteen is True" & @LF & "$15 is greater than 0 but smaller than $7 y $10",0) EndIf Test 9 ;simple mathematics test to see which number is smaller but greater then zero ;whichever number is the smallest but greater than zero becomes true at the end $seven = False $ten = False $fifteen = False ;in this test $7 and $15 cannot be true unless we change the value Global $7 = 0,$10 = 10,$15 = 15 ; ; ; ;test 9 If Not $7 = 0 Then if ($7 < $10) And ($7 < $15) Then $seven = True EndIf ; If Not $10 = 0 Then If ($10 < $7) and ($10 < $15) Then $ten = True EndIf ; If Not $15 = 0 Then If ($15 < $7) And ($15 < $10) Then $fifteen = True EndIf ; if $seven = True Then MsgBox(0,"Notice!", "Seven is True" & @LF & "$7 is greater than 0 but smaller than $10 y $15",0) EndIf ; if $ten = True Then MsgBox(0,"Notice!", "Ten is True" & @LF & "$10 is greater than 0 but smaller than $7 y $15",0) EndIf ; if $fifteen = True Then MsgBox(0,"Notice!", "Fifteen is True" & @LF & "$15 is greater than 0 but smaller than $7 y $10",0) EndIf Well that's all I got I've finally finished copying..... I know I'm provably doing so much lines for a simple thing but again I'm a noob.