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 have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list 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:
Topic revision: r3 - 2008-10-01 - KathyDeLaCruz
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.