Right.  Some searches can happen as a result of detecting certain patterns
without explicitly entering the name of a search.  These are a bit different
than the rest, but not much.  These automatic searches used to be in search.htm,
but some were moved to their own files (as they should be).

In order for the searchbar to work without those searches (moving them to a
self-contained search file implied they were optional), the code in
search.htm:def() checks to search if there's a method defined for detecting a
pattern (autodetect_currency).  If there is, it's called.  If the
autodetect_currency determines that it matches an expected pattern, it calls
curr2 to do the conversion.

I don't remember why there are two routines (curr,curr2), other than maybe one
supports switches and one doesn't.  'curr()' is used when someone types in "curr
/from:usd /to:gbp 100", the other is used when someone enters "100 usd>gbp".

One was probably just left from the original code.  If someone wanted to they
could clean this up and merge the routines into a single 'curr' method.  It
would be less confusing.

Glenn

P.S. I've had an idea related to these 'autodetect' searches for a while.  I'll
follow-up with a separate note to the dev list.

----- Original Message -----
From: "Tim Dierks" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 16, 2002 1:32 PM
Subject: Re: [DQSD-Users] conversion problems


> At 10:45 AM 8/16/2002 -0700, John W. Bairen, Jr. wrote:
> >my best shot at it is that the only function in curr.xml that does
> >anything is curr().  i don't think the functions curr2() or
> >autodetect_currency() do anything as they would have to be called from
> >curr() and they are not.  i could be wrong here, but i don't think i am.
> >
> >try this... back up your current curr.xml.  remove the 2 functions
> >(curr2() and autodetect_currency()) from the file.  save it and
> >reload.  does it still work?
>
> Nope; I can see that the only code that parses the "gbp>usd" is in
> autodetect_currency which calls curr2().
>
> After a little more investigation, I've found that currency is magic;
> autodetect_currency is called directly from search.html, not invoked
> through the standard searches mechanism. Other operations that work this
> way are:
>   - translations
>   - URLs
>   - phone numbers
>   - math expressions
>
> The searches "ia" and "ggc" are even more magic; ggc doesn't seem to be in
> the latest install, but it still gets exempted from the above magic.
>
> All very curious....
>
>   - Tim
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: OSDN - Tired of that same old
> cell phone?  Get a new here for FREE!
> https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
> _______________________________________________
> Dqsd-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dqsd-users
> http://sourceforge.net/mailarchive/forum.php?forum_id=8601
>



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Dqsd-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dqsd-users
http://sourceforge.net/mailarchive/forum.php?forum_id=8601

Reply via email to