Tags:
create new tag
, view all tags

Question

Guys, I bet this is a very simple task to do. But I'm just unable to find out a nice way of doing it.

I'm using FormattedSearch to print the results in table. The $rev variable is used to print the revision. In support web, $rev reduced by 1 gives the number of answers to a question asked. How do I do $rev-1 in a formatted search?

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: SpreadSheetPlugin
Server OS: Windows XP
Web server: Apache 2.3
Perl version: 5.8.8
Client OS: Windows XP
Web Browser: IE 6
Categories: Plugins, Add-Ons

-- TWikiGuest - 28 Dec 2007

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.

Assuming you've got the SpreadSheetPlugin installed, you can write %CALC{$EVAL($rev-1)}%. To use this inside a %SEARCH% statement, you have to escape the percentage signs: $percntCALC{$EVAL($rev-1)}$percnt

-- MartinKaufmann - 28 Dec 2007

Martin, thanks a lot for the response. %CALC($EVAL(a-b)) works fine outside search. But inside search, $percntCALC{$EVAL($rev-1)}$percnt it is not working out. I even tried escaping the $ of EVAL. But it is not working as expected.

-- TWikiGuest - 31 Dec 2007

Let's try this out:

topic: SubtractingValues, rev: 6, rev-1: 5

It works as expected.

-- PeterThoeny - 31 Dec 2007

Yep.. it does work. I made a small syntax error in some other portion of the search query & that affected the formula. Thanks a lot for the response guys.

-- TWikiGuest - 02 Jan 2008

 
Change status to:
Topic revision: r6 - 2008-01-02 - TWikiGuest
 
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.