Tags:
create new tag
view all tags

Question

Hello,

I'm having a problem with IF statements.

If it evaluate to true, then I get a "1" in my page instead of the "then" text.

I've got:

%IF{"'%USERNAME%'='KathyDeLaCruz'" then "test text"}%
And when I'm KathyDeLaCruz, the page displays a 1
If I'm not, I get nothing. So I think the if statement is evaluating correctly - it's just not displaying what I want.

Can someone tell me what I'm doing wrong?

Thanks!
Kathy

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Windows 2003 Server
Web server: Apache 2
Perl version: indigoperl 5,86
Client OS: Windows Vista
Web Browser: Firefox
Categories:  

-- KathyDeLaCruz - 01 Oct 2008

Answer

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.

Try this:

%IF{ "$ WIKINAME='KathyDeLaCruz'" then="test text" }%
For a full description see IfStatements.

-- MartinKaufmann - 01 Oct 2008

Oooh, that works perfectly with the spaces. Thank you!

-- KathyDeLaCruz - 01 Oct 2008

Change status to:
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2008-10-01 - KathyDeLaCruz
 
  • 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.