Re: [WebDNA] Filtering exact numbers

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 101334
interpreted = N
texte = To expand on Donovan's point here... Given your code, [TheManufacturers] will end up with a space-delimited listing of [ManSerialNumber] values, which is good as long as you are guaranteed that [ManSerialNumber] will never contain a space character (if the values may contain spaces, a different delimiter should be used). In your last line, if you force space characters around [TheManufacturers] and [Manufacturer], then you should get what you're looking for: [showif [url] [TheManufacturers] [/url]^[url] [Manufacturer] [/url]] For example, given the manufacturer values "1234", "52345" and "2345", your "TheManufacturers" value would be "1234 52345 2345" If Manufacturer is set to "2345", your showif would evaluate to (%20 being a url'ed space character): [showif %201234%2052345%202345%20^%202345%20] which would evaluate to TRUE. If Manufacturer is set to "234", your showif would evaluate to: [showif %201234%2052345%202345%20^%20234%20] which would evaluate to FALSE. Even though the string contains "234" as portions of manufacturer values, adding the delimiters makes the test essentially check for whole words. This is a common technique I use in my code, as it is considerably faster than using listwords and checking each value independantly. Brian Fries BrainScan Software On Nov 3, 2008, at 11:18 AM, Donovan Brooke wrote: > Suzanne Swift wrote: > >> Here's the exact code... >> [search db=../ >> vl_binderloc.db&eqClientIDdatarq=[_ClientID]&ClientIDtype=num] >> [text]TheManufacturers=[/text] >> [founditems] >> [text]TheManufacturers=[TheManufacturers][ManSerialNumber] [/text] >> [/founditems] >> [/search] >> [search db=../reps_per_state.db&eqStatedatarq=[url][TheState][/ >> url]&eqStateRegiondatarq=[url][TheStateRegion][/ >> url]&neRepIDdatarq=[blank]] >> [founditems] >> [showif [repID]![Manufacturer]] >> [showif [url][TheManufacturers][/url]^[url][Manufacturer][/url]] > > > So now that I'm on my lunch break.. :-) I'm reading further.. > > I think you can do a more simple fix here by simply adding > in a space after your second comparison value. > > [showif [url][TheManufacturers][/url]^[url][Manufacturer] [/url]] > > .........................................................^ <--space > there > > since your first list is being deliminated by a space, this small > change *should* ensure that you match exact serialnumbers. > > Donovan > > > > > > > -- > Donovan D. Brooke PH/FAX: 1 (608) 291-2024 > ---------------------------------------------- > VP > WebDNA Software Corporation > 16192 Coastal Highway > Lewes, DE 19958 Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Filtering exact numbers (Suzanne Swift 2008)
  2. Re: [WebDNA] Filtering exact numbers (Brian Fries 2008)
  3. Re: [WebDNA] Filtering exact numbers (Donovan Brooke 2008)
  4. Re: [WebDNA] Filtering exact numbers (Govinda 2008)
  5. Re: [WebDNA] Filtering exact numbers (Donovan Brooke 2008)
  6. Re: [WebDNA] Filtering exact numbers (Suzanne Swift 2008)
  7. Re: [WebDNA] Filtering exact numbers (Donovan Brooke 2008)
  8. Re: [WebDNA] Filtering exact numbers (Donovan Brooke 2008)
  9. Re: [WebDNA] Filtering exact numbers (Patrick McCormick 2008)
  10. Re: [WebDNA] Filtering exact numbers (Suzanne Swift 2008)
  11. Re: [WebDNA] Filtering exact numbers (Kenneth Grome 2008)
  12. Re: [WebDNA] Filtering exact numbers (Lawrence 2008)
  13. [WebDNA] Filtering exact numbers (Suzanne Swift 2008)
To expand on Donovan's point here... Given your code, [TheManufacturers] will end up with a space-delimited listing of [ManSerialNumber] values, which is good as long as you are guaranteed that [ManSerialNumber] will never contain a space character (if the values may contain spaces, a different delimiter should be used). In your last line, if you force space characters around [TheManufacturers] and [Manufacturer], then you should get what you're looking for: [showif [url] [TheManufacturers] [/url]^[url] [Manufacturer] [/url]] For example, given the manufacturer values "1234", "52345" and "2345", your "TheManufacturers" value would be "1234 52345 2345" If Manufacturer is set to "2345", your showif would evaluate to (%20 being a url'ed space character): [showif %201234%2052345%202345%20^%202345%20] which would evaluate to TRUE. If Manufacturer is set to "234", your showif would evaluate to: [showif %201234%2052345%202345%20^%20234%20] which would evaluate to FALSE. Even though the string contains "234" as portions of manufacturer values, adding the delimiters makes the test essentially check for whole words. This is a common technique I use in my code, as it is considerably faster than using listwords and checking each value independantly. Brian Fries BrainScan Software On Nov 3, 2008, at 11:18 AM, Donovan Brooke wrote: > Suzanne Swift wrote: > >> Here's the exact code... >> [search db=../ >> vl_binderloc.db&eqClientIDdatarq=[_ClientID]&ClientIDtype=num] >> [text]TheManufacturers=[/text] >> [founditems] >> [text]TheManufacturers=[TheManufacturers][ManSerialNumber] [/text] >> [/founditems] >> [/search] >> [search db=../reps_per_state.db&eqStatedatarq=[url][TheState][/ >> url]&eqStateRegiondatarq=[url][TheStateRegion][/ >> url]&neRepIDdatarq=[blank]] >> [founditems] >> [showif [repID]![Manufacturer]] >> [showif [url][TheManufacturers][/url]^[url][Manufacturer][/url]] > > > So now that I'm on my lunch break.. :-) I'm reading further.. > > I think you can do a more simple fix here by simply adding > in a space after your second comparison value. > > [showif [url][TheManufacturers][/url]^[url][Manufacturer] [/url]] > > .........................................................^ <--space > there > > since your first list is being deliminated by a space, this small > change *should* ensure that you match exact serialnumbers. > > Donovan > > > > > > > -- > Donovan D. Brooke PH/FAX: 1 (608) 291-2024 > ---------------------------------------------- > VP > WebDNA Software Corporation > 16192 Coastal Highway > Lewes, DE 19958 Brian Fries

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Help!!!! Purchases not going through! FIXED! (1997) WebCat2 Append problem (B14Macacgi) (1997) Multiple catalog databases and showcart (1997) More on the email templates (1997) WebCat2 as a chat server? (1997) Searching multiple Databases (1997) problem using ErrorMessages.db to redirect requests (2004) WebCat Error Log problem (2.0.1, acgi, Mac) (1997) The max=0 issue is a bug ... (2000) typhoon... (1997) [WebDNA] TCPConnect example doesn't work (2017) [AppendFile] problem (WebCat2b13 Mac .acgi) (1997) Pirated WebCat? NOT... (2003) BUG in [showif] using ^ (contains) (1997) [WebDNA] [append] does not add the newline char at the end of the new record?! (which causes subsequent [search] to fail.) (2009) WebCat Emailer & Liststar (1997) Web Catalog 2 demo (1997) system crashes, event log (1997) Aaron kant add (or whatever it was) (2000) Summing fields (1997)