Problem with loop of array elements
fischer at mail.sub.uni-goettingen.de
Tue Nov 15 09:58:01 EST 2005
I have a small script that extracts URLs from an HTML page (see below).
This works nicely if I do it step by step using the debugger.
But if I let it run, I get only every other URL with blank lines in between.
Does anybody have an idea what's going on?
put cd fld "SaveFile" into theSearchFile
open file theSearchFile
read from file theSearchFile until end
close file theSearchFile
put it into theSearchResult
repeat while numToChar(it) is in theSearchResult
add 1 to it
replace "<p class=g>" with numToChar(it) in theSearchResult
split theSearchResult by numToChar(it)
put empty into theSearchResult
put empty into foundURLs
repeat for each element foundURL in theSearchResult
split foundURL by quote
put foundURL & return after foundURLs
repeat while char 1 of foundURLs is return
delete char 1 of foundURLs
put "file:" & theSearchFile & "-Links" into theSearchFile
put foundURLs into URL theSearchFile
More information about the Use-livecode