RE: errors in ex.err

new topic     » topic index » view thread      » older message » newer message

>From: Kat <gertie at visionsix.com>
>Reply-To: EUforum at topica.com
>To: EUforum at topica.com
>Subject: errors in ex.err
>Date: Sat, 9 Oct 2004 12:44:01 -0500
>
><from ex.err>
>================
>u:\newsgetter\Eu webgetter tcp4u\Getabcnews4.exw:478
>slice lower index is less than 1 (-4)
>
>u:\newsgetter\Eu webgetter tcp4u\Getabcnews4.exw:478	        if
>length(href)
>and not equal(href,"") and
>
>  href = {47'/'}
>
>=========================
===
></from>
>
>The entire if-then code is:
>}}}
<eucode>
>         if length(href) and not equal(href,"") and
>            (not match("/REUTERS",upper(href))) and
>            (not match("/AP",upper(href))) and
>            (
>            (not match(".HTML",upper(href[length(href)-5..length(href)])))=
=20
>and
>            (not match(".HTM", upper(href[length(href)-4..length(href)])))=

>            )
>           then href = ""
>         end if
></eucode>
{{{

>

   You could get this error if href were somewthing like "www". Then
length(href)-5 = 3-5 = -2 which is obviously not correct. Perhaps you c=
ould=20
do something like this:

if length(href) and
            (not match("/REUTERS",upper(href))) and
            (not match("/AP",upper(href))) and
            (
            (match(".HTML",upper(href)) != length(href) - 5) and
            (match(".HTM", upper(href)) != length(href) - 4)
            ) then
             href = ""
         end if


  That would save you the subscripting, but might be problematic for
something like "www.something.com/here.htm?whatever.html". I don't know if=

your data would contain something like that though.

>As you can see, i FIRST test to see if there is anything at all in href,=

>and that
>is where Eu is reporting i made a mistake. Naturally, i am now testing to=

>see
>if (length(href) > 5) .
>

   Eu is reporting the line of the if statement because the rest of the
stuff is one big expression. It could be better, I'm sure.

>Kat
>

~[ WingZone ]~
http://wingzone.tripod.com/

s

first two months FREE*.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu