<div>Hi Peter,</div><div><br></div><div>Thank you for your reply.</div><div>Until now, I can&#39;t make first (a) suggestion work (neither yyyy neither yyyy-mm)</div><div>I have to say that what I called Date (maybe a bad idea ?) is the yyyy year of the publication, not a yyyy-mm-dd formated date ; basically something like :</div>
<div>Date : 2003</div><div>or, (when multiple editions*)</div><div>Date : 1996, 2003, 2009</div><div>As there is no Date in form of : Date : 2003-01 I&#39;m not sure I will get successfull using something like : if=&quot;date 1993-01..$:Date-01&quot; (I deleted the space after ..).</div>
<div><br></div><div>(c) works and is clearer than mine.</div><div><br></div><div>I&#39;m also in trouble with (b) greateq and numcomp (parse error, unexpected T_CASE ; for numcomp).</div><div><br></div><div>Of course, I may have done some errors while testing (a) and (c).</div>
<div><br></div><div><div>*Does anyone know how to extract the first 4 signs from a ptv, as in : </div><div>Date : 1896, 1932, 1966</div><div>{(substr &quot;{=$:Date}&quot; 0 4)} failed in following pagelist I test to select pages where 4 first types from Date are &gt; 1993 (for example, Date : 1995, 2005) :</div>
<div>(:pagelist trail=Argot.BibliographieDesDictionnaires fmt=#titredate {(substr {=$:Date} 0 4)}=199[3-9],20[0-9][0-9] count=10:)</div></div><div><br></div><div>Thank you !</div><br><div class="gmail_quote">2009/10/29 Peter Bowers <span dir="ltr">&lt;<a href="mailto:pbowers@pobox.com">pbowers@pobox.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Thu, Oct 29, 2009 at 6:49 PM, ABClf &lt;<a href="mailto:languefrancaise@gmail.com">languefrancaise@gmail.com</a>&gt; wrote:<br>

&gt; Hello the list,<br>
&gt; My question today is about using range, or &gt; or &lt; with pagelist.<br>
&gt; My purpose is to list pages where $:Date is &gt;=1993<br>
<br>
</div>I don&#39;t think this capability is built into pmwiki.  Here are some<br>
possible alternatives...<br>
<br>
(a) Use the if=&quot;date 1993-01.. $:Date-01&quot;<br>
<br>
I&#39;m not sure if appending that -01is necessary or whether it will even<br>
work -- just an idea<br>
<br>
(b) Create your own conditional operator<br>
<br>
if=&quot;greateq $:Date 1993&quot;<br>
<br>
See <a href="http://www.pmwiki.org/wiki/Cookbook/ConditionalMarkupSamples" target="_blank">http://www.pmwiki.org/wiki/Cookbook/ConditionalMarkupSamples</a> --<br>
I&#39;ve taken a shot at modifying the &quot;equal&quot; condition below (no<br>
promises -- just a quick shot):<br>
<br>
$Conditions[&#39;greateq&#39;] = &#39;GreaterEqualArgs($condparm) == 0&#39;;<br>
function GreaterEqualArgs($arg) {<br>
$arg = ParseArgs($arg); return (@$arg[&#39;&#39;][0] &gt;= @$arg[&#39;&#39;][1]);<br>
}<br>
<br>
[1]<br>
<br>
(c) It&#39;s not ideal, but you can use character classes to make your<br>
wildcards a lot easier to maintain<br>
<div class="im"><br>
(:pagelist trail=Argot.BibliographieDesDictionnaires fmt=#title<br>
</div>$:Date=199[3-9],20[0-9][0-9]:)<br>
<br>
Hope that helps!  (Note that these are just ideas to point you in<br>
possible directions - no testing whatsoever..)<br>
<br>
-Peter<br>
<br>
<br>
[1] This idea could be very easily generalized to allow for any binary<br>
numerical comparison...<br>
<br>
if=&quot;numcomp $:Date &gt;= 1993&quot;<br>
<br>
$Conditions[&#39;numcomp&#39;] = &#39;NumericCompareArgs($condparm) == 0&#39;;<br>
function NumericCompareArgs($arg) {<br>
   $arg = ParseArgs($arg);<br>
   # Would be nice to check $arg[&#39;&#39;][1] here using in_array() and give<br>
an error message<br>
   # Would be nice to check for existence and numericalness of [0] and<br>
[2] and error nicely<br>
   switch (@$arg[&#39;&#39;][1]) {<br>
      case &#39;&gt;&#39;: return (@$arg[&#39;&#39;][0] &gt; @$arg[&#39;&#39;][2])<br>
      case &#39;&gt;=&#39;: return (@$arg[&#39;&#39;][0] &gt;= @$arg[&#39;&#39;][2])<br>
      case &#39;&lt;&#39;: return (@$arg[&#39;&#39;][0] &lt; @$arg[&#39;&#39;][2])<br>
      case &#39;&lt;=&#39;: return (@$arg[&#39;&#39;][0] &lt;= @$arg[&#39;&#39;][2])<br>
      case &#39;!=&#39;: return (@$arg[&#39;&#39;][0] != @$arg[&#39;&#39;][2])<br>
      default: return (@$arg[&#39;&#39;][0] == @$arg[&#39;&#39;][2]);<br>
   }<br>
}<br>
<br>
Of course it could be done much more simply with eval() but then you<br>
have all kinds of security implications and you end up with even more<br>
code to deal with that...<br>
<br>
No testing whatsoever on any of this code.  You&#39;re on your own for that...<br>
</blockquote></div><br><br clear="all"><br>-- <br>---------------------------------------<br>| A | de la langue française<br>| B | <a href="http://www.languefrancaise.net/">http://www.languefrancaise.net/</a><br>| C | <a href="mailto:languefrancaise@gmail.com">languefrancaise@gmail.com</a><br>
---------------------------------------<br>