Posted Thu, 01 Jan 2015 06:00:00 GMT by Portal Admin

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 : ""}

You must be signed in to post in this forum.