New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists

Feature Proposal: Implement a CALCULATE macro as a registered macro


I am implementing some macros in my plugin and I need to nest my macro and CALC macro outside a table. However, it gaves unexpected result because the CALC macro doesn't follow exactly left-to-right inside-to-outside rules.

Description and Documentation

I need to use the CALC outside a table, but I need the CALC to be expanded exactly as left-to-right inside-to-outside. The current CALC can't do it because it is handled through commonTagsHandler. If we can create a macro CALCULATE as registered macro, it will make sure we can nest it into other macros properly. TWiki already has this feature. It is not hard to implement, but don't know why it is commented out in Foswiki.


%<nop>CALCULATE{"$SET(options, $LISTITEM(2, ))"}%

%<nop>SESSION_VARIABLE{"myvalue" set="%<nop>CALCULATE{"$GET(options)"}%"}%

Currently use CALC macro for above statements in a single topic will cause unexpected result.




-- Contributors: ChunHuang - 02 Jul 2013


This has already been implemented on Foswiki/trunk. See Tasks.Item8417.

-- MichaelDaum - 02 Jul 2013
Topic revision: r3 - 03 Nov 2015, GeorgeClark - This page was cached on 21 Jun 2018 - 17:14.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy