Tags:
create new tag
view all tags

SID-00093: How to work around IF statement limitation in 4.1.1?

Status: Unanswered 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:

  1. percent IF{" ('T'='F' or 'T'='F') and ('T'='T' or 'T'='F' or 'T'='F')" then = "true WRONG!" else = "false CORRECT"}percent
  2. 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:

  1. true WRONG!
  2. true WRONG!

But if I try it in the sandbox here with version 4.2.2, it works correctly.

  1. false CORRECT
  2. 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

      Change status to:
ALERT! 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.
SupportForm
Status Unanswered
Title How to work around IF statement limitation in 4.1.1?
SupportCategory CategoryAPI
TWiki version 4.1.1
Server OS

Web server

Perl version

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2009-04-17 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.