Quote:
|
Originally Posted by master007
example, the following psudocode:-
|
As DaWei rightly points out, there are better ways to get the same functionality. Refactoring your code to use the common "break" statement is simple enough:
while True:
EvaluationCode()
if errortype == 1:
statements
break
if errortype == 2:
statements
break
if errortype == 3:
statements
break Although for code that seems to handle errors, exceptions would seem the best tool to use:
try:
while True:
EvaluationCode()
except Exception, errortype:
if errortype == 1:
statements
elif errortype == 2:
statements
elif errortype == 3:
statments