Messages

Jim Ault JimAultWins at yahoo.com
Sun Sep 4 20:18:02 EDT 2005


I APPOLOGIZE!!

I should NOT have sent the last email to the list regarding Mark's very good
contribution that clarifies messages with an example.

It has been a long day, I typed the response quickly and as soon as I sent
it I regretted it.

Again, very sorry for my mistake.
My message definitely does not belong on this list!
Bad taste.  Won't happen again.

(maybe the list mom will kill it and no one will know)

Jim Ault
Las Vegas


On 9/4/05 11:13 AM, "Mark Wieder" <mwieder at ahsoftware.net> wrote:

> Tom-
> 
> And just to make things a bit clearer:
> 
> There are three objects drinking at a bar:
> A button, a card, and a stack.
> The button only drinks Guinness
> The card only drinks Bud Light
> The stack will drink anything with alcohol
> 
> They each have a Drink handler:
> 
> in the button handler:
> on Drink pSomething
>   if pSomething is "Guinness" then
>     answer "the button drank it"
>   else
>     pass Drink pSomething
>   end if
> end Drink
> 
> in the card handler:
> on Drink pSomething
>   if pSomething is "Bud Light" then
>     answer "the card drank it"
>   else
>     pass Drink pSomething
>   end if
> end Drink
> 
> in the stack handler:
> on Drink pSomething
>   if HasAlcohol(pSomething) then
>     answer "the stack drank it"
>   else
>     pass Drink pSomething
>   end if
> end Drink
> 
> The button also has a mouseUp handler:
> on mouseUp
>   Drink field "fromBartender"
> end mouseUp
> 
> (and there's also obviously a field called "fromBartender")
> 
> Now put something into the "fromBartender" field and click the button.
> The button's mouseUp handler sends the "Drink" message out to see who
> catches it. And do check out Richard's writeup on this. Here's a
> bonus: once you get the concept of messages, everything else falls
> into place pretty easily.
> 
> Saturday, September 3, 2005, 12:19:32 PM, Dan wrote:
> 
>> Great analogy.
> 
> Indeed.





More information about the Use-livecode mailing list