Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] how to delete array element?
#7
I have a small problem. It says "invalid index". The offending code is at the bottom. The rest is there for context.

Code:
Copy      Help
;init array of strings, l
ARRAY(str) list_of_urls

int i

str pattern=
;<div class="morefg">\r\n.*<a href="(.*)">Read more

if(0=findrx(s pattern 1 4 list_of_urls)) end "not found"

;deletes urls that don't match domain
str d="domain.com"

for i 0 list_of_urls.len
    if find(list_of_urls[1 i] d) = -1
        list_of_urls.remove(1 i)

Thanks for reading.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)