Tags:
create new tag
view all tags

SID-00510: CALC within SEARCH + Glue

Status: Answered Answered TWiki version: 4.2.4 Perl version:
Category: CategoryPlugins Server OS: Last update: 14 years ago

I have a SpreadSheet calculation embedded in a formatted SEARCH result.

I tried to do this:

%~~ SEARCH{"
*~~ META:FORM{name=\"StandardsForm\"" nonoise="on" 
~~~ format="|$topic| $formfield(StandardName) | $formfield(DateAccepted) |
~~~  $percntCALC{ $IF( $TIME($formfield(DateAccepted)) > $TIMEADD($TIME(), -2, month), $percntN$percnt, ) }$percnt |
~~~ "  }%

and it prints the complete =%CALC{ $IF{ ...}%" string as a literal string in the results.

  • screenshot:
    _SID-00510.jpg

If, instead, I do this:

%SEARCH{"META:FORM{name=\"StandardsForm\"" nonoise="on" 
  format="|$topic| $formfield(StandardName) | $formfield(DateAccepted) | $percntCALC{ $IF( $TIME($formfield(DateAccepted)) > $TIMEADD($TIME(), -2, month), $percntN$percnt, ) }$percnt |"  }%

i.e., no glue, the %CALC{...}% function is evaluated as expected

  • screenshot:
    _SID-00510_2.jpg

The order as showm by %PLUGINDESCRIPTIONS% is

  • GluePlugin
  • DatabasePlugin
  • SpreadSheetPlugin

which., I would have thought, would mean Glue is evaluated first. But pperhaps I'm mistaken.,

Do we have an ordering problem? Can we fix it? My real search is much larger and longer than the snippet shown here; I'd like to use zGlue but I need ti include that calculation.

-- VickiBrown - 2009-08-28

Discussion and Answer

I am not familiar with the glue plugin.

I add preferences settings to WebPreferences with calc snippets that I can use in spreadsheet calcs. This makes long calcs manageable.

-- PeterThoeny - 2009-08-29

%~~ SEARCH means to escape the search, i.e., show the search command instead on doing the search.
Change the first line to %SEARCH... and you should be good to go.

-- SeanCMorgan - 2009-08-29

Seems to be answered?

Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider engaging one of the TWiki consultants if you need timely help. We invite you to get involved with the community, it is more likely you get community support if you support the open source project!

-- PeterThoeny - 2009-10-02

No, Sean, that's not correct. <verbatim> %~~ SEARCH </verbatim> doesn't escape the search. That's GLUE syntax.

-- VickiBrown - 2011-06-15

I am closing this old question.

Vicki, your workplace uses TWiki in a mission critical way, yet has never contributed a single line of code to the TWiki project, nor has given any business to TWiki. If you engage and support the TWiki community you are much more likely to get support from the community. Something you could discuss with your management.

-- PeterThoeny - 2011-06-16

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title CALC within SEARCH + Glue
SupportCategory CategoryPlugins
TWiki version 4.2.4
Server OS

Web server

Perl version

Topic attachments
I Attachment History Action Size Date Who Comment
JPEGjpg _SID-00510.jpg r1 manage 35.4 K 2009-08-28 - 16:26 UnknownUser screenshot
JPEGjpg _SID-00510_2.jpg r1 manage 17.5 K 2009-08-28 - 16:29 UnknownUser screenshot
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2011-06-16 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.