Ben,

You can use the "return" command in a handler to return something that will
come back in "the result". Here's an example:

Button script:

on mouseUp
    DoStuff
    answer the result
end mouseUp


Card script:

on DoStuff
    return "Hello"
end DoStuff


When you click the button, you should get "Hello" in an answer dialog.

Hope this helps,

Ken Ray
Sons of Thunder Software
Email: [EMAIL PROTECTED]
Web Site: http://www.sonsothunder.com/

----- Original Message -----
From: "Ben Rubinstein" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 19, 2001 9:39 AM
Subject: setting the result


> Can a function set 'the result' separately from the result it returns?  CF
> the way that "answer file" sets "it" and "the result" separately; or
> "copyResource" is a function, but sets "the result" (according to the
docs);
> or... I'm not aware of any other examples.
>
> I'm planning a library in which it would seem natural for various
functions
> under certain situations to return empty, while setting 'the result' to
> indicate why they did; or even in some cases to return non-empty valid
data,
> but also setting "the result" to note some anomalies.  Obviously I can
have
> a dedicated global for this purpose; or a special function; but it would
> seem neater to use 'the result'.
>
> Is it possible?
>
> TIA,
>
>   Ben Rubinstein               |  Email: [EMAIL PROTECTED]
>   Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
>   http://www.cogapp.com        |  Fax  : +44 (0)1273-728866
>
>
>

Reply via email to