Meaning of "with output" in code blocks?


I feel like I’m missing something obvious, but I don’t understand the meaning of the “with output” part of several code blocks. For example, Sound.Play and Alert.Show both include a line that says “with output” that does not seem to have any identifiable purpose.

Thanks in advance for any help!

The output content varies from block to block.

Screen Shot 2020-09-08 at 9.20.08 AM

For Sound–>Play, the output is error which is a text string containing an error message about why the sound file could not be played.

For Alert–>Show, the output tells you whether or not the user has clicked the confirmation button.

You can drag the green blocks into Label display blocks, If/Then blocks, etc. if you need that information.

1 Like

Thank you for the explanation! I now understand that the “with output” line refers to the block below it. I was thinking they were separate. It’s odd they’re on different lines.

Now I’m trying to figure out how to do some basic canvas manipulation. I thought I’d try to get circles drawn wherever the user touches. However, I seem to misunderstand what the “pointer” block’s purpose is, shown in the code below:

pointer question

What is the “pointer” block for and how is it used? By using it to set a label’s text, it just shows “0”, implying it’s empty?

I’ve never used the canvas so I’m probably not the best person to answer but I’ll take a crack at it anyway. It looks like you’re using it correctly with pointer’s x and pointer’s y. But pointer would be an object with various properties so trying to view it with a Label won’t work (or will return an error).

I would try setting a Label’s Text to pointer’s x or pointer’s y and see if it’s returning values you are expecting.

The documentation looks a little different than what you have:


1 Like

Thank you both for the quick replies! Unfortunately, I wasn’t clear in my question. I had read the documentation and seen that example, but am confused on what the point of the “pointer” parameter is. I’ll try to rephrase: if you’re supposed to access pointers through Canvas1.activePointer then why have a pointer parameter? What is it for?

This parameter “pointer” contains the number of fingers that touch the screen at the same time. It can be from 1 to 4 and more touches. If one finger is touched, it is equal to the active pointer.

Thank you!