RE: [REPLACE] inside [FOUNDITEMS]

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 19177
interpreted = N
texte = How about this:[SEARCH db=my.db&eqSKUdatarq=[v.sku]] [FOUNDITEMS] [INV]

[REPLACE db=my.db&eqSKUdatarq=[sku]]INV=100[/REPLACE] [INV] [/FOUNDITEMS] [/SEARCH]Use a variable to search, and then use the sku from the search results.Aloha, Olin> -----Original Message----- > From: Dave MacLeay [mailto:dave@digitalfrontier.com] > Sent: Wednesday, July 29, 1998 9:31 AM > To: WebDNA-Talk@smithmicro.com > Subject: Re: [REPLACE] inside [FOUNDITEMS] > > > It's all because you're using the devil's SKU :-) > > Seriously, as far as I know, that's the way it's always worked. A [search] > generates it's own internal table of found items, idexed by their position > in the database (row #). The [founditems] context loops through that > internal table, and pulls the values from the specified row. Niether > [search] nor [founditems] have any memory (term used loosely) of the > state of these records at the time of the search. > > Since all changes are RAM-based and _instantanious_, the > behaivior that you > described is normal and expected. > > As has been discussed several times on this list, using [delete] inside > [founditems] will really screw things up. Don't even think about going > there. > > -Dave > > > > At 3:34 PM 7/29/98, Michael Winston wrote: > >2.1.6 through 3.0b4, MAC PI > > > >I discovered something today and I'm not sure if it's a bug or a feature: > > > >Let's say I have a record with SKU=666 and INV=30, > > > >[SEARCH db=my.db&eqSKUdatarq=666] > >[FOUNDITEMS] > >[INV]

> >[REPLACE db=my.db&eqSKUdatarq=666]INV=100[/REPLACE] > >[INV] > >[/FOUNDITEMS] > >[/SEARCH] > > > >returns: > >30 > >100 > > > >I expected: > >30 > >30 > > > >I never expected that the [REPLACE] would change my [FOUNDITEMS] results. > >I thought it would replace the value in the database but leave > the returned > >values of my [SEARCH] untouched. This could (and has) caused quite a few > >logic errors in some scripts. > > > >Has this been going on for long? > > > >Michael > > > >Michael Winston *By e-mail!: michaelw@dhorse.com > >Internet Coordinator *By web!: http://www.dhorse.com/ > >Dark Horse Comics, Inc. *By fax!: 503/654/9440 > > > o--------------- Dave MacLeay --+ > o----------- Digital Frontier --+ > o--- dave@digitalfrontier.com --+ > > > Associated Messages, from the most recent to the oldest:

    
  1. Re: [REPLACE] inside [FOUNDITEMS] (Kenneth Grome 1998)
  2. Re: [REPLACE] inside [FOUNDITEMS] (Peter Ostry 1998)
  3. Re: [REPLACE] inside [FOUNDITEMS] (Michael Winston 1998)
  4. Re: [REPLACE] inside [FOUNDITEMS] (Kenneth Grome 1998)
  5. Re: [REPLACE] inside [FOUNDITEMS] (Bob Minor 1998)
  6. Re: [REPLACE] inside [FOUNDITEMS] (PCS Technical Support 1998)
  7. Re: [REPLACE] inside [FOUNDITEMS] (Michael Winston 1998)
  8. Re: [REPLACE] inside [FOUNDITEMS] (PCS Technical Support 1998)
  9. Re: [REPLACE] inside [FOUNDITEMS] (Dave MacLeay 1998)
  10. Re: [REPLACE] inside [FOUNDITEMS] (PCS Technical Support 1998)
  11. Re: [REPLACE] inside [FOUNDITEMS] (Kenneth Grome 1998)
  12. RE: [REPLACE] inside [FOUNDITEMS] (Olin 1998)
  13. Re: [REPLACE] inside [FOUNDITEMS] (Dave MacLeay 1998)
  14. RE: [REPLACE] inside [FOUNDITEMS] (Olin 1998)
How about this:[SEARCH db=my.db&eqSKUdatarq=[v.sku]] [founditems] [INV]

[REPLACE db=my.db&eqSKUdatarq=[sku]]INV=100[/REPLACE] [INV] [/FOUNDITEMS] [/SEARCH]Use a variable to search, and then use the sku from the search results.Aloha, Olin> -----Original Message----- > From: Dave MacLeay [mailto:dave@digitalfrontier.com] > Sent: Wednesday, July 29, 1998 9:31 AM > To: WebDNA-Talk@smithmicro.com > Subject: Re: [replace] inside [founditems] > > > It's all because you're using the devil's SKU :-) > > Seriously, as far as I know, that's the way it's always worked. A [search] > generates it's own internal table of found items, idexed by their position > in the database (row #). The [founditems] context loops through that > internal table, and pulls the values from the specified row. Niether > [search] nor [founditems] have any memory (term used loosely) of the > state of these records at the time of the search. > > Since all changes are RAM-based and _instantanious_, the > behaivior that you > described is normal and expected. > > As has been discussed several times on this list, using [delete] inside > [founditems] will really screw things up. Don't even think about going > there. > > -Dave > > > > At 3:34 PM 7/29/98, Michael Winston wrote: > >2.1.6 through 3.0b4, MAC PI > > > >I discovered something today and I'm not sure if it's a bug or a feature: > > > >Let's say I have a record with SKU=666 and INV=30, > > > >[SEARCH db=my.db&eqSKUdatarq=666] > >[founditems] > >[INV]

> >[REPLACE db=my.db&eqSKUdatarq=666]INV=100[/REPLACE] > >[INV] > >[/FOUNDITEMS] > >[/SEARCH] > > > >returns: > >30 > >100 > > > >I expected: > >30 > >30 > > > >I never expected that the [replace] would change my [founditems] results. > >I thought it would replace the value in the database but leave > the returned > >values of my [search] untouched. This could (and has) caused quite a few > >logic errors in some scripts. > > > >Has this been going on for long? > > > >Michael > > > >Michael Winston *By e-mail!: michaelw@dhorse.com > >Internet Coordinator *By web!: http://www.dhorse.com/ > >Dark Horse Comics, Inc. *By fax!: 503/654/9440 > > > o--------------- Dave MacLeay --+ > o----------- Digital Frontier --+ > o--- dave@digitalfrontier.com --+ > > > Olin

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:

Shownext from POST (2000) Another IfThenElse question.. (2003) Sort Order on a page search (1997) Shipping Costs Not Updating When Adding Items (1997) Error: this shopping cart has already been submitted (2003) [WebDNA] Some code inside a large loops fail ... but why? (2010) webdna&domain name again (2003) Separate SSL Server (1997) pictures / referrer etc. (1998) Understanding variables (1999) Warning: Mac OS X 10.2.4 Update Overwrites Apache's (2003) [protect admin] (1997) [WebDNA] OT: what is the "right" platform ? (2009) 4.5 to 5.0 question (2003) autosensing lanague selection (1997) Rank=off, reverse direction (2004) Database Strategy - more... (1998) Spiders, robots, whatever you want to call them (1998) multi-paragraph fields (1997) Updating Prices in Online Database (1999)