I have several situations where there are 3 or more alternatives that are acceptable.
I have a Hazard factor table that has Min & Max fields, then a user entry field where they enter the Hazard factor (number) they deem to be applicable.
I have a test that enables them to enter either nothing or zero or any number within the given Min/Max range.
In the Exit event, this is what I've done:
var actHaz = this.rawValue;
switch(actHaz)
{
case 0:
xfa.host.setFocus(Haz[1].Hazh);
break;
case (>= HazMin.rawValue) & (<= HazMax.rawValue):
xfa.host.setFocus(Haz[1].Hazh);
break;
case null:
xfa.host.setFocus(Haz[1].Hazh);
break;
default:
xfa.host.messageBox("This 'h' value can only be either 10 or 60. Please re-enter.");
xfa.host.setFocus(this);
break;
}
Everything works except the 'range' case. I assume I've got the syntax wrong. I've been scouring the web but can't find an answer. Does anyone know how I should structure that range test for this?
case label :
statements;
break;
case label :
statements;
break;
...
default : statements;
}
Where:
expression - Value matched against label.
label - Identifier used to match against expression.
statements -Block of statements that is executed once if expression matches label.
George Kaiser