- This topic has 4 replies, 3 voices, and was last updated 16 years, 8 months ago by .
-
Topic
-
I need to do one of the following in order to finish my xlate. Could someone give me a tip on how to do this? Background:
I have a list variable throughout the entire xlate that is created in a tcl fragment at the start of the xlate.
I need to:
A. Have an IF statement that references the list variable. If there are 0 items in the list then kill (suppress) the message. If there are items then continue on with the message. I’ve been unable to do this because it says
Quote:[0:TEST] IF expression parse failed: Expected ‘(‘ or Identifier
Error occurred at: ‘{[llength $lr] > 0}’
[0:TEST] Unable to compile XLT ‘ADT_TO_TEST.xlt’.
Or a similar message to that. My if statement looks like one of the 3 following, but nothing seems to work. (note, these all arent typed in at once, just one at a time)
Quote:([llength $lr] > 0)
or
[llength $lr] > 0
or
{[llength $lr] > 0}
B. Another thought was to do this in a tcl fragment, then I can check the length and put it in an IF statement easily. But how, in a tcl fragment, do I suppress a message.
My code for that way would look like this in a fragment
Quote:if {[llength $lr] > 0} {
echo greater than 0
} else {
echo less than or equal to 0
#we need to kill the message since there aren’t items in the list
}
Thank you for taking a look.
- The forum ‘Cloverleaf’ is closed to new topics and replies.