jlosgar
Joined: 18 Jul 2007 Posts: 651
|
Posted: Fri Apr 17, 2009 9:06 am Post subject: Is there a character limitation on the eval macro? |
|
|
Q. Is there a character limitation on the eval macro? The two lines below are identical, except in the second line I shortened the eval on the value == 5 from:
== 5 ? "Major: Missing Time Update":
To:
== 5 ? "Major: Update":
The first line fails, while the second line is fine:
Broken:
\4\Missing Time Update: ${eval: $semAlarmMissingTimeUpdate == 1 ? "Clear" : $semAlarmMissingTimeUpdate == 2 ? "Minor: Missing Time Update" : $semAlarmMissingTimeUpdate == 3 ? "Minor: Missing Time Update": $semAlarmMissingTimeUpdate == 5 ? "Major: Missing Time Update": $semAlarmMissingTimeUpdate}
Works:
\4\Missing Time Update: ${eval: $semAlarmMissingTimeUpdate == 1 ? "Clear" : $semAlarmMissingTimeUpdate == 2 ? "Minor: Missing Time Update" : $semAlarmMissingTimeUpdate == 3 ? "Minor: Missing Time Update": $semAlarmMissingTimeUpdate == 5 ? "Major: Update":
$semAlarmMissingTimeUpdate}
A. There is a 255 character limitation in the body of the eval. One possible workaround is to break up the eval into separate evals, like this (using abbreviations for better readability):
${eval: $sem == 1 ? "Clear" : ""}${eval: $sem == 2 ? "Minor" : ""}${eval: $sem == 3 ? "Minor" : ""}${eval: $sem == 5 ? "Major" : ""}${eval: (($sem < 1) || ($sem > 5)) ? $sem : ""} |
|