GREAT POST!!!! (and great site, btw. This is my first time posting to it, I
only saw it last week, and I love it so much I've decided that when I put up my
own web site I'll put a link to here rather than try doing my own site of tips!)
I do have a way to improve upon his formula, though. There's a more
straightforward way using *+. In formulas, if you had
"a":"b" *+ "A":"B"
then you get
"aA":"aB":"bA":"bB"
You can use this to get sequential numbers...
digits := "0":"1":"2":"3":"4":"5":"6":"7":"8":"9";
zeroto99 := digits *+ digits;
zerotoN := @Subset(zeroto99; N + 1);
So to rewrite his code, I'd use
REM "NOTE: start param must be before count param in the original URL";
pageString := "<a href=\"SearchView?" + @LeftBack(Query_String;"&start") +
"&start=";
REM "We are limited to 250 docs by domino!!";
hitNum := @If(TotalHits > 250;250;TotalHits);
GREAT POST!!!! (and great site, btw. This is my first time posting to it, I only saw it last week, and I love it so much I've decided that when I put up my own web site I'll put a link to here rather than try doing my own site of tips!)
I do have a way to improve upon his formula, though. There's a more straightforward way using *+. In formulas, if you had "a":"b" *+ "A":"B" then you get "aA":"aB":"bA":"bB"
You can use this to get sequential numbers... digits := "0":"1":"2":"3":"4":"5":"6":"7":"8":"9"; zeroto99 := digits *+ digits; zerotoN := @Subset(zeroto99; N + 1);
So to rewrite his code, I'd use
REM "NOTE: start param must be before count param in the original URL"; pageString := "<a href=\"SearchView?" + @LeftBack(Query_String;"&start") + "&start=";
REM "We are limited to 250 docs by domino!!"; hitNum := @If(TotalHits > 250;250;TotalHits);
adJust := @Integer(hitNum/10); digits := "0":"1":"2":"3":"4":"5":"6":"7":"8":"9"; zeroto99 := digits *+ digits; numlist := @TextToNumber(@Subset(@Subset(zeroto99; adJust + 1); -adJust)); textList1 := @Text(numList*10) + " - " + @Text((numList + 1)*10); textList10 := @Text(numList * 10);
@If(TotalHits > 10;"<p>"+ @Implode(pageString + textList10 + "&count=10\">" + textList1 + "</a>";" | ");" ")
(Note: This was entered "from the hip" so to speak, it might not work as is, I'm just trying to impart the general idea.)