Delete URL... and the result

Dave Cragg dcragg at lacscentre.co.uk
Mon Jun 28 17:12:16 EDT 2004


At 1:52 pm -0400 25/6/04, Troy Rollins wrote:
>When I use "delete URL", the documentation says that "the result"
>will be empty if it works, and populated with an error message if
>not.
>
>In my case, the result is not empty. It contains something like
>"error 200 Okay." But the delete works.

This sounds like a libUrl bug.

I take it you're using delete with http urls. You're probably the 
first person to do this as few http servers support the DELETE 
command. As a result, this feature hasn't been tested thoroughly.

As a workaround, you can check for success like this:

   if the result is empty or word 2 of the result is 200 then


>The odd part is, if I test
>the result, like -
>
>if the result contains "Okay" then
>	send actNatural to me
>ELSE
>	answer warning the Result with "OK"
>end if
>
>It goes to the answer option (the else) and displays the result
>containing "Okay". If I put the result to the message window, it is
>empty.
>
>Can anyone give me a clue what is going on here?

I can't explain this last bit. But are you doing anything between the 
"delete url" statement and the above that might change "the result"? 
(A function call, or something.) In that case, you should probably 
store the result in a variable immediately after the delete 
statement. (Looking again, "contains" will probably change the result 
value.)

    delete url <url>
    put the result into tRes
    ## whatever
    if tRes is empty or word 2 of tRes is 200 then
      actNatural
    else
        answer warning tRes with "OK"
    end if

Cheers
Dave


More information about the use-livecode mailing list