• 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: compactness of expression question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compactness of expression question


  • Subject: Re: compactness of expression question
  • From: billp <email@hidden>
  • Date: Thu, 17 Jan 2002 15:51:01 -0600

Hi Paul,

I had them inside the if statements because the handler that
contains this snippet is utilized by a variety of other handlers
in a larger script, and some of these ItemCounts may or may not
happen at all, depending on characteristics of the file being
processed. I figured it was a way to conserve memory, because
the variable "ItemCount" can be reused at different points.
Its value does not need to persist.

Bill


>I've never made a global statement midway through a script rather than at
>the top, but I believe that will work. (Otherwise you'd declare them all as
>global at the top, then just define the one you need - not so good.) Any
>particular reason not just to declare
>
>global ItemCount
>
>and then just do:
>
> if {ItemKind} is in {"Lines", "Paragraphs"} then
> set ItemCount to ItemCount as integer
> end if
>
>Or do you need all these different ItemCounts at once?
>
>--
>Paul Berkowitz


  • Prev by Date: search and replace question
  • Next by Date: RE: [OT] Software design, beta testing, and the like
  • Previous by thread: Re: compactness of expression question
  • Next by thread: Re: compactness of expression question
  • Index(es):
    • Date
    • Thread