[WebDNA] Some code inside a large loops fail ... but why?
This WebDNA talk-list message is from 2010
It keeps the original formatting.
numero = 104423
interpreted = N
texte = When I run a loop that iterates 10 times it seems to work fine. Everything inside the loop is processed correctly, and the data gets written to the db as expected. But when I iterate 10000 times the replace context fails to record the data to the db:[loop start=1&end=10000][text]rawData=[removehtml][tcpconnect host=www.website.com&port=80][tcpsend skipheader=T]GET /folder/file.asp?record=[index] HTTP/1.0[unurl]%0D%0A%0D%0A[/unurl][/tcpsend][/tcpconnect][/removehtml][/text][replace append=T&db=database.db&eqsomefielddatarq=[index]]somefield=[index]&html=[url][rawData][/url][/replace][/loop]Network activity continues while the large loop is running, and it looks just like the network activity that exists when the small loop is run, so I believe the tcpconnect is functioning properly. But for some reason no data gets written to the db in the large loop.Any idea why the replace fails when I set the number of iterations so high?-----------------------------Another question which may lead to new insights here:When the tcpconnect fails to get a response, what happens? Does it prevent the rest of the loop from executing? If so, is there some kind of timeout built into tcpconnect that we can use to force the loop to continue after such a tcpconnect freeze/failure?Sincerely,Kenneth Gromewww.KenGrome.com
Associated Messages, from the most recent to the oldest:
When I run a loop that iterates 10 times it seems to work fine. Everything inside the loop is processed correctly, and the data gets written to the db as expected. But when I iterate 10000 times the replace context fails to record the data to the db:[loop start=1&end=10000]
[text]rawData=
[removehtml][tcpconnect host=www.website.com&port=80][tcpsend skipheader=T]GET /folder/file.asp?record=[index] HTTP/1.0
[unurl]%0D%0A%0D%0A[/unurl][/tcpsend][/tcpconnect][/removehtml][/text][replace append=T&db=database.db&eqsomefielddatarq=[index]]somefield=[index]&html=
[url][rawData][/url][/replace][/loop]Network activity continues while the large loop is running, and it looks just like the network activity that exists when the small loop is run, so I believe the tcpconnect is functioning properly. But for some reason no data gets written to the db in the large loop.Any idea why the replace fails when I set the number of iterations so high?-----------------------------Another question which may lead to new insights here:When the tcpconnect fails to get a response, what happens? Does it prevent the rest of the loop from executing? If so, is there some kind of timeout built into tcpconnect that we can use to force the loop to continue after such a tcpconnect freeze/failure?Sincerely,Kenneth Gromewww.KenGrome.com
Kenneth Grome
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:
The code, one more time. (2003)
shoppingcart reload qty (1997)
No Subject Line (2000)
PIXO (1997)
Three Guesses? (2004)
Include a big block of text (1997)
Accepting credit cards (1997)
Re:[ShowIf] and empty fields (1997)
Where has WebDNA shown up in your life? (2003)
2.0 Info (1997)
[taxRate] [TaxTotal] ? (1997)
Improper naming convections? (2004)
NT vs Mac (1997)
passwords (2000)
exclamation mark... (1999)
Sku numbers (1997)
SiteGaurd file Cache vs webcatalog cache (1997)
[Webcat 2]Next (1997)
Test (2001)
[protect] (2000)