• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Re: Impossible "If"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Impossible "If"?
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: Scope of globals, parents and children, "load script" an
  • Next by Date: Re: Impossible "If"?
  • Previous by thread: [OFF] Re: Impossible "If"?
  • Next by thread: Re: Impossible "If"?
  • Index(es):
    • Date
    • Thread