Difference: SpreadSheetPlugin (12 vs. 13)

Revision 132006-05-13 - PeterThoeny

Line: 1 to 1
 

TWiki Spreadsheet Plugin

This Plugin adds spreadsheet capabilities to TWiki topics. Formulae like %CALC{"$INT(7/3)"}% are evaluated at page view time. They can be placed in table cells and outside of tables. In other words, this Plugin provides general formula evaluation capability, not just classic spreadsheet functions.

Line: 66 to 66
 

Changed:
<
<

AND( list ) -- logcial AND of a list

>
>

AND( list ) -- logical AND of a list

 
  • Syntax: $AND( list )
  • Example: %CALC{"$AND(1, 0, 1)"}% returns 0
  • Related: $NOT(), $IF(), $OR()
Line: 197 to 197
 
  • Specify the variable name (alphanumeric characters and underscores). An empty string is returned if the variable does not exist. Use $SET() to set a variable first. Unlike table ranges, variables live for the time of the page view and persist across tables, i.e. you can use it to summarize results across several tables.
  • Syntax: $GET( name )
  • Example: %CALC{"$GET(my_total)"}% returns the value of the my_total variable
Changed:
<
<
>
>
 

IF( condition, value if true, value if 0 ) -- return a value based on a condition

Line: 346 to 346
 

Changed:
<
<

OR( list ) -- logcial OR of a list

>
>

OR( list ) -- logical OR of a list

 
  • Syntax: $OR( list )
  • Example: %CALC{"$OR(1, 0, 1)"}% returns 1
  • Related: $AND(), $IF(), $NOT()
Line: 376 to 376
 

PROPERSPACE( text ) -- properly space out WikiWords

  • Properly spaces out WikiWords preceeded by white space, parenthesis, or ][. Words listed in the DONTSPACE TWikiPreferences variable or DONTSPACE Plugins setting are excluded
  • Syntax: $PROPERSPACE( text )
Changed:
<
<
  • Example: Assuming DONTSPACE contains MacDonald: %CALC{"$PROPERSPACE(Old MacDonald had a ServerFarm, EeEyeEeEyeOh"}% returns Old MacDonald had a Server Farm, Ee Eye Ee Eye Oh
>
>
  • Example: Assuming DONTSPACE contains MacDonald: %CALC{"$PROPERSPACE(Old MacDonald had a ServerFarm, EeEyeEeEyeOh)"}% returns Old MacDonald had a Server Farm, Ee Eye Ee Eye Oh
 

Line: 431 to 431
 

SET( name, value ) -- set a variable for later use

Changed:
<
<
  • Specify the variable name (alphanumeric characters and underscores) and the value. The value may contain a formula; formulae are evaluated before the variable assignment; see $NOEXEC() if you want to prevent that. This function returns no output. Use $GET() to retrieve variables. Unlike table ranges, variables live for the time of the page view and persist across tables, i.e. you can use it to summarize results across several tables and also included topics
>
>
  • Specify the variable name (alphanumeric characters and underscores) and the value. The value may contain a formula; formulae are evaluated before the variable assignment; see $NOEXEC() if you want to prevent that. This function returns no output. Use $GET() to retrieve variables. Unlike table ranges, variables live for the time of the page view and persist across tables, i.e. you can use it to summarize results across several tables and also across included topics
 
  • Syntax: $SET( name, value )
  • Example: %CALC{"$SET(my_total, $SUM($ABOVE()))"}% sets the my_total variable to the sum of all table cells located above the current cell and returns an empty string
Changed:
<
<
>
>

SETIFEMPTY( name, value ) -- set a variable only if empty

  • Specify the variable name (alphanumeric characters and underscores) and the value.
  • Syntax: $SETIFEMPTY( name, value )
  • Example: %CALC{"$SETIFEMPTY(result, default)"}% sets the result variable to default if the variable is empty or 0; in any case an empty string is returned
  • Related: $GET(), $SET()
 

SETM( name, formula ) -- update an existing variable based on a formula

  • Specify the variable name (alphanumeric characters and underscores) and the formula. The formula must start with an operator to + (add), - (subtract), * (multiply), or / (divide) something to the variable. This function returns no output. Use $GET() to retrieve variables
  • Syntax: $SETM( name, formula )
  • Example: %CALC{"$SETM(total, + $SUM($LEFT()))"}% adds the sum of all table cells on the left to the total variable, and returns an empty string
Changed:
<
<
>
>
 

SIGN( num ) -- sign of a number

Line: 603 to 610
 
data/TWiki/SpreadSheetPlugin.txt Plugin topic
data/TWiki/SpreadSheetPlugin.txt,v Plugin topic repository
lib/TWiki/Plugins/SpreadSheetPlugin.pm Plugin Perl module
Changed:
<
<
  • (Dakar) Visit configure in your TWiki installation, and enable the plugin in the {Plugins} section.
>
>
  • TWiki 4 and up: Visit configure in your TWiki installation, and enable the Plugin in the {Plugins} section.
 
  • Test if the "Total" in the first table in this topic is correct.

Plugin Info

Plugin Author: TWiki:Main/PeterThoeny
Changed:
<
<
Plugin Version: 17 Jun 2005 (1.018)
>
>
Copyright: © 2001-2006, Peter@Thoeny.org, StructuredWikis LLC
License: GPL (GNU General Public License)
Plugin Version: 13 May 2006 (10197)
 
Change History:
<-- specify latest version first -->
 
Added:
>
>
13 May 2006: Added $SETIFEMPTY(); fixes in documentation
 
17 Jun 2005: Added $NOEXEC(), $EXEC()
25 Mar 2005: Fixed evaluation bug when using SpeedyCGI accelerator; code refactor to load module only when needed, contributed by TWiki:Main/CrawfordCurrie
24 Oct 2004: Added $EXISTS(), contributed by TWiki:Main/RodrigoChandia; added $PERCENTILE()
Line: 647 to 657
 
Perl Version: 5.000 and up
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/SpreadSheetPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/SpreadSheetPluginDev
Added:
>
>
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/SpreadSheetPluginAppraisal
  Related Topics: TWikiPreferences, TWikiPlugins
Changed:
<
<
-- TWiki:Main/PeterThoeny - 17 Jun 2005
>
>
-- TWiki:Main/PeterThoeny - 13 May 2006
 
 
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
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.SpreadSheetPlugin