Hi again!
I have some topics named like this:
- ThisIsTopic2004x45
- ThisIsTopic2004x46
Where 2004 is the current year and 45 and 46 is the week of the year.
Now, I'd like to %SEARCH% the topics with the current week in the current year. I have already patched the
SpreadSheetPlugin to replace
$weekofyear by the current week of the year (
Date::Calc did the job), so that's not a problem anymore. My search first looked like this:
%SEARCH{search="Weekly.*%CALC{"$FORMATTIME($NOW,$weekofyear)"}%" type="regex" scope="topic" format=" * $topic"}%
I soon found that %SEARCH% wanted to close itself after the first occurence of }%, so I tried to set a custom variable:
* Set WEEK = %CALC{"$FORMATTIME($NOW,$weekofyear)"}%
%SEARCH{search="Weekly.*%WEEK%" type="regex" scope="topic" format=" * $topic"}%
The result is exactly the same :-/. It looks like $weekofyear doesn't get expanded before the %CALC% thing takes place.
Is there a way to solve that?
Thanks a lot
André
--
AndreBonhote - 08 Nov 2004
You hit a rendering order issue. SEARCH executes before CALC, you need the reverse. See related
CollectingInformationOnUserPages. Your CALC needs to construct the SEARCH:
%CALC{$percntSEARCH{search=\"Weekly.*$FORMATTIME($NOW,$weekofyear)\" type=\"regex\" scope=\"topic\" format=\" * $topic\"}$percnt}%
--
PeterThoeny - 09 Nov 2004
Topic revision: r2 - 09 Nov 2004 - 06:57:13 -
PeterThoeny