Dynamic condition in a loop

Hello everybody! My first post in here and I must warn you that I’m a N00b:sailor:

I have a loop in a function which condition depends on some variables a,b,c and d. I would like to change that condition depending on where the function is called from. Would it be possible to assign those conditions to a variable (string maybe)?

Like this

function varcon():void{
while (conditionVar){
a=…
b=…
blah blah
}

conditionVar= “a==0 && b==0”;
varcon();

conditionVar= “a==0 || b==0”;
varcon();