On Tue, 8 Dec 1998, Gilles Detillieux wrote:

> According to htDig user:
> > Is it possible to sort the results of htdig-requests by date?
 
> Well, I'm just speculating here, because I haven't tried it.  I'd start by
> adding a new compare() method to the Display class, such as compareDate().
> It would be like compare(), except the value it returns would be something
> like:
>       return m2->getRef()->DocTime() - m1->getRef()->DocTime();

I could only wish it was so easy :-)

I am currently writing my own routines for this sorting-stuff...

Somehow, I'm unable to access the DocTime, DocTitle and such values. 
e.g. In Display.cc, I've tried something like this:

  printf("%s",array[counter]->getRef()->DocTitle());

It _IS_ a string, according to ../htcommon/DocumentRef.cc ....

Am I missing something here?

printf("%s",array[counter]->getURL()) works fine.. Think I need to write
my own getTime() when I want to sort my results by date......  :-)

> Then, in Display::sort(), you'd have to test the value of a new input
> parameter, e.g. input["sortby"], to see if it selects a sort by date.
> If so, the final argument it passes to qsort() would be 
> Display::compareDate instead of Display::compare.

I skipped that extra-parameter part. It's ok with me to work with separate
htsearch executeables... 
 

Is there someone out there who can help me out? 

----------------------------------------------------------------------
To unsubscribe from the htdig mailing list, send a message to
[EMAIL PROTECTED] containing the single word "unsubscribe" in
the body of the message.

Reply via email to