SID-00093: How to work around IF statement limitation in 4.1.1?
| Status: |
Unanswered |
TWiki version: |
4.1.1 |
Perl version: |
|
| Category: |
CategoryAPI |
Server OS: |
|
Last update: |
16 years ago |
The percent IF statement in my TWiki version seems to have a problem. For example, if I run the following test:
- percent IF{" ('T'='F' or 'T'='F') and ('T'='T' or 'T'='F' or 'T'='F')" then = "true WRONG!" else = "false CORRECT"}percent
- percent IF{" ('T'='F' or 'T'='F') and ('T'='T' or 'T'='F')" then = "true WRONG!" else = "false CORRECT"}percent
I get the following output on my 4.1.1 version:
I get the following output:
- true WRONG!
- true WRONG!
But if I try it in the sandbox here with version 4.2.2, it works correctly.
- false CORRECT
- false CORRECT
So it seems like this is a bug that was fixed. Since we're unfortunately not going to be upgrading our version of TWiki soon, is there another way to do this test with percent IF that works around the problem? I seem to remember reading somewhere that you can't nest percent IF statements, so I don't think that will work.
I tried rewriting the statement, even with duplicating one of the parenthesized clauses with mixed success; it's hard to work around the bug without knowing what the problem actually is.
(I'm doing this as a part of a percent SEARCH format statement, and I can't use the spreadsheet IF due to quotes in the included text, so I have to stick with the IF statement.)
--
AndyEvans - 10 Feb 2009
Discussion and Answer
Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider engaging one of the
TWiki consultants if you need timely help. We invite you to
get involved with the community, it is more likely you get community support if you support the open source project!
--
PeterThoeny - 2009-04-17
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.