Checking Server Results If Return is HTML
revdan at danshafer.com
Fri Dec 19 20:27:10 EST 2003
I have an app that sends an HTTP request to a server that returns
either a non-negative number if the request succeeds or an HTML
formatted error page if it fails.
In my Rev script, I do:
put URL tURL into serverReturn
if char 1 of serverReturn = 1 then
put "User successfully created" into field serverReturn
put "Error encountered but no error checking implemented yet." into
(tURL is the URL to which I'm sending the request, just in case that's
If the outcome is successful, the server in this case returns a value
of 1. This works in my code. But if an error is created, I never get
the second display. Instead, the debugger tells me "Chunk: No Such
Object" and the hint has the first two HTML tags of the return value.
Also, FWIW, most of the time when this happens, my Rev app in the Rev
IDE becomes completely non-responsive and I have to quit Revolution.
The app will save, so I haven't lost anything yet but this is really
Dan Shafer, Revolutionary
Author of "Revolution: Software at the Speed of Thought"
http://www.revolutionpros.com for more info
Available at Runtime Revolution Store (http://www.runrev.com/RevPress)
More information about the Use-livecode