Item1998: Spreadsheet Plugin $RIGHT() is broken

pencil
Priority: Urgent
Current State: Closed
Released In: 1.1.0
Target Release: minor
Applies To: Extension
Component: SpreadSheetPlugin
Branches:
Reported By: RaymondLutz
Waiting For:
Last Change By: KennethLavrsen
SpreadSheetPlugin $RIGHT() function is supposed to return the range of cells to the right of the current cell. Unfortunately, it returns cells to the left as well.

Test of RIGHT:

Col 3 below contains the expression: %CALC{"$SUM($RIGHT())"}%

Col 1 Col 2 Col 3 Col 4 Col 5
1 2 12 4 8
16 32 192 64 128

The correct answers are 12 and 192. Apparently, RIGHT includes one column to the left as well.

Test of LEFT:

Col 3 below contains the expression: %CALC{"$SUM($LEFT())"}%

Col 1 Col 2 Col 3 Col 4 Col 5
1 2 3 4 8
16 32 48 64 128

The correct answers above, are 3 and 48.

This works correctly.

Suggestion

Enhance $RIGHT() and $LEFT() to accept a value which is the number of cells to the right or left to include. For example $LEFT(2) would include the two cells to the left and no more.


PATCH

Attached trivial patch fixes this out by 2 error...

  • Calc.diff: Patch to fix this trivial but very annoying bug

Note - made this urgent because it seems a pretty good idea to include such a trivial fix for such a complete breakage of functionality in the release.

-- DarrylGreen - 08 Aug 2010

Good move. Fix merged to trunk, thanks Darryl!

-- CrawfordCurrie - 09 Aug 2010

ItemTemplate edit

Summary Spreadsheet Plugin $RIGHT() is broken
ReportedBy RaymondLutz
Codebase 1.0.6
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component SpreadSheetPlugin
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:7beb1e462116
TargetRelease minor
ReleasedIn 1.1.0
Topic attachments
I Attachment Action Size Date Who Comment
Calc.diffdiff Calc.diff manage 356 bytes 08 Aug 2010 - 07:28 DarrylGreen Patch to fix this trivial but very annoying bug
Topic revision: r5 - 04 Oct 2010, KennethLavrsen
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