Re: Inconsistent Code

This WebDNA talk-list message is from

2006


It keeps the original formatting.
numero = 67435
interpreted = N
texte = [replacefounditems] doesn't apply in his case, because the replace is on a different database (events.db) than the search (carts.db)... This is,however, a perfect example of when to use a SWITCH/CASE instead of a bazillion SHOWIFs, and since the replace parameters are the same (only the data changes) for each option, I would put the data to be replaced into a text variable, then just use one REPLACE context: [switch value=[ITEM]] [case value=R1][text]DATA=RETRIEVER1STATUS=PAID[/text][/case] [case value=R2][text]DATA=RETRIEVER2STATUS=PAID[/text][/case] .... etc .... [case value=SV7][text]DATA=SUPERV7STATUS=PAID[/text][/case] [default][text]DATA=[/text] [/switch] [showif [url][DATA][/url]!] [Replace db=events.db&eqCOMPIDdatarq=[COMPID]&eqDOGIDdatarq=[DOGID]] [DATA][/Replace] [/showif] This is just a style choice, but it makes maintenance much easier. Also, the [waitforfile] is not being used properly - it needs an ending [/waitforfile] tag. Brian Fries BrainScan Software On Jun 12, 2006, at 9:28 PM, Gary Krockover wrote: > Also, you might look into using a [replacefounditems] context > instead of the [replace] inside of the [founditems] loop. See: > http://webdna.smithmicro.com/ref/pages.html? > context=ReplaceFoundItemsContext.html > > GJK > > > At 03:30 PM 6/12/2006, you wrote: >> This piece of code is driving me nuts. It works about 65% of the >> time and the rest of the time, it either does some or none of what >> it's supposed to do. Does anyone see anything that might be >> causing this one? HELP!!!!! > ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Inconsistent Code ( Brian Fries 2006)
  2. Re: Inconsistent Code ( Gary Krockover 2006)
  3. Re: Inconsistent Code ( Gary Krockover 2006)
  4. Re: Inconsistent Code ( Marko Bernyk 2006)
  5. Inconsistent Code ( "Steve Dannaway" 2006)
[replacefounditems] doesn't apply in his case, because the replace is on a different database (events.db) than the search (carts.db)... This is,however, a perfect example of when to use a SWITCH/CASE instead of a bazillion SHOWIFs, and since the replace parameters are the same (only the data changes) for each option, I would put the data to be replaced into a text variable, then just use one REPLACE context: [switch value=[ITEM]] [case value=R1][text]DATA=RETRIEVER1STATUS=PAID[/text][/case] [case value=R2][text]DATA=RETRIEVER2STATUS=PAID[/text][/case] .... etc .... [case value=SV7][text]DATA=SUPERV7STATUS=PAID[/text][/case] [default][text]DATA=[/text] [/switch] [showif [url][DATA][/url]!] [Replace db=events.db&eqCOMPIDdatarq=[COMPID]&eqDOGIDdatarq=[DOGID]] [DATA][/Replace] [/showif] This is just a style choice, but it makes maintenance much easier. Also, the [waitforfile] is not being used properly - it needs an ending [/waitforfile] tag. Brian Fries BrainScan Software On Jun 12, 2006, at 9:28 PM, Gary Krockover wrote: > Also, you might look into using a [replacefounditems] context > instead of the [replace] inside of the [founditems] loop. See: > http://webdna.smithmicro.com/ref/pages.html? > context=ReplaceFoundItemsContext.html > > GJK > > > At 03:30 PM 6/12/2006, you wrote: >> This piece of code is driving me nuts. It works about 65% of the >> time and the rest of the time, it either does some or none of what >> it's supposed to do. Does anyone see anything that might be >> causing this one? HELP!!!!! > ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ 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:

ANother SHOWIF problem (1997) writefile to create static pages (2003) Alternating colors (1997) [append] vs. [appendfile] delta + question? (1997) Bug? (1997) Couple of techno questions (1999) A few questions about server configuration (2000) I am dumb. No see [variable] (2003) [WebDNA] WebDNA 7 multiple fcgid processes (2012) [WebDNA] Virtual server (2011) Missing Cart Information (2003) PIXO support (1997) Errata: WCS Newbie question (1997) WebCatalog can't find database (1997) [WebDNA] read database from other domain (2015) changing prices in cart (1997) How do you hide [math]stuff[/math] (1997) service stop and restart (1997) Generating and appending SKU to a db automatically (1998) Delayed Redirect (2000)