Not clear exactly what your requirement is, but it would be something like this:
if (faillengthtest($foo)) { if (failrepeattest($foo)) { #format the page with error msg 1 } else { #format the page with error msg 2 } } else { #format the page normally }
Might be a good idea to wrap your testing in two functions to make the code clearly expressed.
Update:
Actually to exercise all 4 combinations, the code should be (obviously you could tailer some branches, if they don't appear to be a real combination under your requirement):
if (faillengthtest($foo)) { if (failrepeattest($foo)) { #format the page with error msg 1 } else { #format the page with error msg 2 } } else { if (failrepeattest($foo)) { #format the page with error msg 3 } else { #format the page with normal message } }
In reply to Re: Multiple testing methods
by pg
in thread Multiple testing methods
by sulfericacid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |