Pygar
EQ2Bot Specialist
Feel like a noob asking this but not having much luck getting this syntax right.
I have a function that does some stuff and has several return codes (success, error1, error2, error3). I want to call this then run a switch/case on the results if it returns anything other than success.
So whats the proper syntax for above 'metacode'? I'm sure I've missed something simple in my attempts to get this working.
I know there's an arguement of just have the function call something else on the error and try to get to a return success, but there are some conditional differences that makes me want to evaluate it this way.
Thanks.
I have a function that does some stuff and has several return codes (success, error1, error2, error3). I want to call this then run a switch/case on the results if it returns anything other than success.
Code:
Call myfunction var1 var2
If myfunction.return.value != success
{
switch myfuntion.return.value
{
case error1
do some stuff
break
case error2
do some other stuff
break
}
}
I know there's an arguement of just have the function call something else on the error and try to get to a return success, but there are some conditional differences that makes me want to evaluate it this way.
Thanks.