Re: limited numbers of variables?
Re: limited numbers of variables?
- Subject: Re: limited numbers of variables?
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 03 Mar 2003 08:29:48 -0800
On 3/3/03 7:55 AM, "Mr Tea" <email@hidden> wrote:
>
This from Thomas Strohmaier - dated 3/3/03 2:03 pm:
>
>
> is there a limit for the number of used variables?
>
>
I'll leave that question to someone who actually knows the answer, but I
>
seem to recall that on pre-OS X systems the size of the stuff stored in the
>
variables was also a limiting factor.
>
>
> Some variables of subroutines seems not to work, they dont change there
>
> values and they dont appear in the ScriptDebuggers Variable/Property
>
> list.
This is really a question for the SD mailing list. If you read the manual
for SD (p. 3-37), you'll see that in order for variables in handlers to show
up in Debugging pane when in Debugging mode, you must explicitly declare
each one as local within the handler:
local var1, var2, etc,
In a rare number of cases, you may have to enter the handler parameter
names as a comment with an = sign:
--= param1
just below the local declarations.. I have only ever had to do that twice in
about 500 scripts and 25,000 parameters.
In any case, all; these local variable values are only available when using
SD in Debugger mode. If you use it in normal AppleScript mode, you do get a
"bonus" in that all the top-level (i.e. run handler) variable values are
still available after the script finishes running. That's because they're
actually global, although undeclared as such. (You'll see that if you
explicitly declare top-level variables as local, they won't be around at the
end either.) And only properties and globals are saved with the script when
it finishes, not local variables.
>
> if i copy/ paste a small part of the script in new window, the
>
> variables are working as expected. if i copy / paste the whole script
>
> in a new window i get the same failure as before.
>
>
We need more information, Thomas. What flavour of the OS are you using? What
>
version of AppleScript? And what is the nature of the data that you are
>
storing in these intermittently functioning variables? A bit of sample code
>
would be useful, too.
You probably mean that when you paste it in "as a main script" you can see
the variables displayed in "Debugging" pane, but not when run as a handler.
This is the same thing as above: you need to declare them as local
variables.
>
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.