Tags:
create new tag
, view all tags

Question

  • Set WEEK = 20
  • Set LASTWEEK = 19
   * Set LASTWEEK = %CALC{$EVAL(%WEEK% - 1)}%

Week 20

%INCLUDE{PlanForWeek%WEEK%}%

Warning: Can't find topic Support.PlanForWeek20

Last Week (Week $LASTWEEK)

%INCLUDE{PlanForWeek%LASTWEEK%}%

Warning: Can't find topic Support.PlanForWeekCALC{EVAL(20-1)}

Why does the above try to include a page called PlanForWeekEVAL 20 -1 instead of PlanForWeek19?

Environment

TWiki version: TWikiRelease04x02x00
TWiki plugins: SpreadSheetPlugin
Server OS: Debian
Web server: Apache
Perl version:  
Client OS:  
Web Browser:  
Categories: Plugins

-- MartinCleaver - 12 May 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.

There seems to be an evaluation nesting limitation, apparently a INCLUDE << SET_PREF << CALC << SET_PREF does not work

Last Week using INCLUDE << CALC << SET_PREF :

%INCLUDE{PlanForWeek%CALC{$EVAL(%WEEK% - 1)}%}%

Warning: Can't find topic Support.PlanForWeek19

This example shows that a INCLUDE << CALC << SET_PREF does work, as expected.

As a workaround you can try to use CALC{$SET()} and $GET() instead of preferences variables.

-- PeterThoeny - 13 May 2008

Thanks Peter.

My goodness, this is unintuitive. I don't suppose there an engineering focus to simplify this?

-- MartinCleaver - 13 May 2008

File an enhancement request, ideally with a patch smile

-- PeterThoeny - 13 May 2008

 
Change status to:
Topic revision: r4 - 2008-05-13 - PeterThoeny
 
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.