Re: any way to tell if a script has a 'return' statement?
Re: any way to tell if a script has a 'return' statement?
- Subject: Re: any way to tell if a script has a 'return' statement?
- From: Arthur J Knapp <email@hidden>
- Date: Thu, 25 Oct 2001 15:55:44 -0400
>
In a message dated 10/25/01 8:52:39 AM, Donald S. Hall wrote:
>
> If you run a script with 'run script', the script can optionally return a
>
> value in the result variable with a return statement.
>
>
>
> Is there any way to determine if a script in fact has a return statement?
>
>
>
> I want to be able to save the result returned by a script to a file, but
>
> since the result will always have something in it (something I don't want to
>
> save if the script doesn't specifically return a value), how do I tell
>
> whether or not I should be saving the result variable? I won't know a priori
>
> if the script I am running has a return statement.
Is this too simple? -
try
set the_result to run script (whatever)
on error
set the_result to missing value
end
if (the_result is not missing value) then
-- save result...
Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden
Hey, check out:
http://www.zavatone.com/