Question
Is there a way to make the row numbers appear in tables constructed using the %SEARCH% function ?
I tried the option of including %CALC{"$ROW()"}% as given below:
%SEARCH{ "^Automatic" web="%WEB%" scope="topic" type="regex" nosearch="on" order="modified" reverse="on" format="| %CALC{"$ROW()"}% | [[$topic]] | $createwikiname | $createdate | $wikiname | $date |" }%
This gives the same number for all rows, as given below:
Number of topics: 9
It works for 'normal' tables though, as given below with:
| %CALC{"$ROW()"}% | test1 |
| %CALC{"$ROW()"}% | test2 |
| %CALC{"$ROW()"}% | test3 |
Environment
--
ChengappaCB - 22 May 2008
Answer
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.
You have to escape (or remove!) the quotes inside
CALC{}, otherwise
SEARCH{} can't parse
format="..CALC{".."}.."=. But that gives the same number for each row:
Number of topics: 9
So you also need to defer the CALC so that it gets executed once per search result, as described in "Search with conditional output" in
FormattedSearch:
Number of topics: 9
You need to do both. If you only defer the CALC and leave the quotes in, you get...
| %CALC{
| %CALC{
| %CALC{
| %CALC{
| %CALC{
| %CALC{
| %CALC{
| %CALC{
| %CALC{
Number of topics: 9
--
SeanCMorgan - 22 May 2008
Perfect. Thank you very much Morgan. I should have seen the
FormattedSearch before asking.
Do you by any chance have an answer to my other (still unanswered) question
AccessRights ?
--
ChengappaCB - 22 May 2008