Re: compactness of expression question
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