• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item7203: Spreadsheet CALCULATE parameters with quoted strings

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension SpreadSheetPlugin Enhancement Closed   major 6.0.0

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

CALC and CALCULATE currently can't handle parameters that happen to have parenthesis or commas as part of the string. For example, $SUBSTITUTE(Good morning, morning, day) works as expected, but $SUBSTITUTE(Good, fun morning, morning, day) does not, assuming the string is "Good, fun morning".

This feature adds quoted text to avoid these "gotchas". Text enclosed in three single quotes is considered a string. Problematic characters (comma, opening and closing parenthesis) are escaped, and the quotes are removed. The escaped characters are restored at the end of the function evaluation.

  • Test: %CALCULATE{$SUBSTITUTE('''Good, fun morning''', morning, day)}%
  • Expected: Good, fun day
  • Actual: Good, fun day

-- TWiki:Main/PeterThoeny - 2013-03-26

ItemTemplate
Summary Spreadsheet CALCULATE parameters with quoted strings
ReportedBy TWiki:Main.PeterThoeny
Codebase ~twiki4, 5.1.4
SVN Range TWiki-5.1.3-trunk, Tue, 19 Mar 2013, build 25461
AppliesTo Extension
Component SpreadSheetPlugin
Priority Enhancement
CurrentState Closed
WaitingFor

Checkins TWikirev:25549 TWikirev:25550 TWikirev:25551 TWikirev:25552 TWikirev:25553 TWikirev:25554
TargetRelease major
ReleasedIn 6.0.0
Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r10 - 2013-10-15 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback