I usually use this idiom to emmulate a case statement in Perl. Easy enough to write and read IMHO.
$caption .= $time eq "30days" ? "Past 30 Days" : $time eq "3mons" ? "Past 3 Months": $time eq "1yr" ? "Past 1 Year" : $time eq "all" ? "All Data" : "FALL_THROUGH_DEFAULT";
In reply to Re: Switch - "case" may clash with future reserved word
by tachyon-II
in thread Switch - "case" may clash with future reserved word
by ahoffmann
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |