r4 - 13 May 2008 - 23:46:04 - PeterThoenyYou are here: TWiki >  Support Web > HowToSaveCalcValueNotJustDisplay
Tags:
, create new tag

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:
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r4 < r3 < r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback SourceForge.net Logo