Help In AutoIt Loops Please! 11-08-2011, 01:24 AM
#1
so i have a code, to calculate what someone got on a test (just practicing basic stuff.) and i have this so far:
and it works, but i want to get it a little better, because when i use it and say you enter 0 as the max grade you could have gotten well i have a message pop up saying enter something other then 0, but then it ends the program, how can i make it so it will loop it back up towhere you enter the number again?
thanks
Code:
Dim $GradeGot = InputBox("Grade You Got","Now Enter The Grade You Got",0)
Dim $Maxgrade = InputBox("Max Grade","Enter The Max Grade You Could Have Got. (Example: 45 out of 50. Enter the 50)",0)
Dim $Percent = $GradeGot/$Maxgrade*100
Switch 1
Case $Maxgrade = 0
MsgBox(0,"Error","Please Enter a Number Bigger Then 0")
Case $Percent > 0
MsgBox(0, "Percent Recevied", "You Got a " & $Percent & " % On Your Test.")
EndSwitchand it works, but i want to get it a little better, because when i use it and say you enter 0 as the max grade you could have gotten well i have a message pop up saying enter something other then 0, but then it ends the program, how can i make it so it will loop it back up towhere you enter the number again?
thanks


![[+]](https://sinister.li/images/modern/collapse_collapsed.png)

