Re: Re: Impossible "If"?
Re: Re: Impossible "If"?
- Subject: Re: Re: Impossible "If"?
- From: email@hidden
- Date: Sat, 19 May 2001 01:16:36 EDT
In a message dated 5/11/01 11:55:44 AM, Andy Wylie wrote:
>
--any more traps for young players like this?
Oh sure, lots!
I'm drowning in digests, so apologies is someone else has already revealed
this trap, but it has bitten me twice. If a string is longer than 32k bytes,
this construct will cause an error:
if myString is equal to "" then
-- do stuff for the case where the string is empty
end if
instead, do this
if length of myString is equal to "" then
-- do stuff for the case where the string is empty
end if
While this does throw an error, it's not intuitive what the workaround is.
Now you know.
The other gotcha is that, in my case, this problem was buried inside multiple
layers of handlers and try blocks, and the error either wasn't bubbling to
the top for me to see (it was in a CGI, which can be tricky to debug), or the
error message was so far removed from the source of the error that a simple
read of the code did not reveal the error. I mean, who would expect [ if
myString = "" ] to err?
Jeff Baumann
email@hidden
www.linkedresources.com