SID-00510: CALC within SEARCH + Glue
| Status: |
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:
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:
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
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.