>[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?Yes! This problem has *always* been there.It is unfortunately still NOT documented, but it is nevertheless a very BAD practice to use delete or replace contexts inside founditems loops. The reason has to do with the way the founditems loop works. It uses the [index] value of the found items in a way that causes it to fail when *any* of the index values change during the looping process. So, since replace and delete are the two actions that can change the relative index values of the items inside the loop, you should NEVER use delete or replace inside a founditems context.Sincerely,Ken Grome808-737-6499WebDNA Solutionsmailto:ken@webdna.nethttp://www.webdna.net
Associated Messages, from the most recent to the oldest:
|
>[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?Yes! This problem has *always* been there.It is unfortunately still NOT documented, but it is nevertheless a very BAD practice to use delete or replace contexts inside founditems loops. The reason has to do with the way the founditems loop works. It uses the [index] value of the found items in a way that causes it to fail when *any* of the index values change during the looping process. So, since replace and delete are the two actions that can change the relative index values of the items inside the loop, you should NEVER use delete or replace inside a founditems context.Sincerely,Ken Grome808-737-6499WebDNA Solutionsmailto:ken@webdna.nethttp://www.webdna.net
Kenneth Grome DOWNLOAD WEBDNA NOW!
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...