don't understand why cascading doesn't work

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

don't understand why cascading doesn't work

GreggInCA
I'm embarrassed to write about this. I've been playing with the code, reading docs, etc. for an hour:

With a Transcript window open, executing any of the following lines (from a Playground):

     Transcript show: 1; ' '; 2; cr.

     Transcript show: 'a'; cr; 'b'.

     Transcript show: 1; cr; '2'.

fails, after which is shown a pink box with the text 'Message expected ->'.

I'm sure it's something simple. What am I missing? Thanks.



Reply | Threaded
Open this post in threaded view
|

Re: don't understand why cascading doesn't work

Sven Van Caekenberghe-2
Gregg,

> On 21 Aug 2018, at 08:08, Gregg Williams <[hidden email]> wrote:
>
> I'm embarrassed to write about this. I've been playing with the code, reading docs, etc. for an hour:
>
> With a Transcript window open, executing any of the following lines (from a Playground):
>
>     Transcript show: 1; ' '; 2; cr.
>
>     Transcript show: 'a'; cr; 'b'.
>
>     Transcript show: 1; cr; '2'.
>
> fails, after which is shown a pink box with the text 'Message expected ->'.
>
> I'm sure it's something simple. What am I missing? Thanks.

You have to repeat the selector, you cannot send a string or a number to an object. #cr is a message though.

    Transcript show: 1; show: ' '; show: 2; cr.

    Transcript show: 'a'; cr; show: 'b'.

    Transcript show: 1; cr; show: '2'.

Furthermore, Transcript only generates output with #show: or #crShow: else it buffers until you send #endEntry or #flush.

HTH,

Sven
Reply | Threaded
Open this post in threaded view
|

Re: don't understand why cascading doesn't work

Richard Sargent
Administrator
In reply to this post by GreggInCA


On Mon, Aug 20, 2018, 23:09 Gregg Williams <[hidden email]> wrote:
I'm embarrassed to write about this. I've been playing with the code, reading docs, etc. for an hour:

With a Transcript window open, executing any of the following lines (from a Playground):

     Transcript show: 1; ' '; 2; cr.

     Transcript show: 'a'; cr; 'b'.

     Transcript show: 1; cr; '2'.

fails, after which is shown a pink box with the text 'Message expected ->'.

I'm sure it's something simple. What am I missing? Thanks.

Sven has answered. I would offer the clarification that "cascaded" refers to message sends. You send successive messages to the same receiver. Those messages may or may not take arguments.