# What does the return 0 block does

**URL:** <https://forum.makecode.com/t/what-does-the-return-0-block-does/3204>\
**Category:** Help\
**Created:** [August 23, 2020, 1:08pm UTC](https://forum.makecode.com/t/what-does-the-return-0-block-does/3204 "2020-08-23T13:08:14Z")\
**Posts on this page:** 9\
**Page:** 4

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [October 3, 2020, 4:02pm UTC](https://forum.makecode.com/t/what-does-the-return-0-block-does/3204/61 "2020-10-03T16:02:10Z")

</div>

There is a circle version of every function that has a return block in it - look closer in the functions tab

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 3, 2020, 4:22pm UTC](https://forum.makecode.com/t/what-does-the-return-0-block-does/3204/62 "2020-10-03T16:22:47Z")

</div>

isn’t a circumference of a circle Diameter x pi  
and radius radius^2 x pi

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [October 3, 2020, 5:13pm UTC](https://forum.makecode.com/t/what-does-the-return-0-block-does/3204/63 "2020-10-03T17:13:03Z")

</div>

> [@UnsignedArduino](#):
>
> There is a circle version of every function that has a return block in it - look closer in the functions tab

@UnsignedArduino

Here is your code that contains my question:

> **[Cannot assign variable to a function that returns](https://arcade.makecode.com/94587-38912-31139-55562)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [October 3, 2020, 6:04pm UTC](https://forum.makecode.com/t/what-does-the-return-0-block-does/3204/64 "2020-10-03T18:04:01Z")

</div>

This is what I meant:

 ![Screenshot_20201003-140333](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/a/a1fac08cc6a8e99d800a5738c749bd3e92f1deba.jpeg)

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [October 3, 2020, 6:19pm UTC](https://forum.makecode.com/t/what-does-the-return-0-block-does/3204/65 "2020-10-03T18:19:45Z")

</div>

You are right. I didn’t see that under functions there are two blocks for the same function. Very strange.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/b/be57fcdb7cf6a0b0531a9fdd9ffadbd430cd08ff.png)

In the blocks UI it looks like the first function _does not_ return a value, and the second one does.

@jwunderl  
Do you know why the UI shows two functions for one function that returns a value?

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [October 3, 2020, 6:30pm UTC](https://forum.makecode.com/t/what-does-the-return-0-block-does/3204/66 "2020-10-03T18:30:02Z")

</div>

For the function ‘call calculateDistanceBetweenPoits’ I can imagine there is not enough room in blocks UI to show the names of the input parameters. That is a pity, as a programmer I have no idea what 1, 1, 1, 1 means. Also, I have no idea what the function returns:

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/7cd00692206876d74c4c25310ff7c5be14edc93d.png)

I guess that’s why block functions are designed for high level basic programming, to set things and not to return something.

Then again, having a block section such as ‘Points’ (x, y on screen) then you might be able to use something like (imitating the block UI)

getDistanceBetweenPoints (pointA) (pointB) : integer

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 3, 2020, 8:43pm UTC](https://forum.makecode.com/t/what-does-the-return-0-block-does/3204/67 "2020-10-03T20:43:42Z")

</div>

@cosmoscowboy @UnsignedArduino that means the return block turns the function into those oval blocks after that?

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [October 3, 2020, 9:02pm UTC](https://forum.makecode.com/t/what-does-the-return-0-block-does/3204/68 "2020-10-03T21:02:00Z")

</div>

If a function has a return block in it, it will have a circle version

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [October 4, 2020, 10:36pm UTC](https://forum.makecode.com/t/what-does-the-return-0-block-does/3204/69 "2020-10-04T22:36:25Z")

</div>

There are two blocks because there are two different use cases; calling the function, and obtaining the value returned from the function. Regular puzzle piece blocks are statements that can be used on their own, but round ones cannot.

For why you would need both; you might make a function that creates a sprite on the right side of the screen, and call it several times. Later on, you need access to the sprite that you made, so you make the function return the sprite / create the round block in the toolbox. You don’t want to have to store the returned sprite every other place that it’s been created, just in the new spot.

re: labels on the functions; that’s something we’ve discussed / is a potential future feature [https://github.com/microsoft/pxt-arcade/issues/1256](https://github.com/microsoft/pxt-arcade/issues/1256), but I’d note that it’s primarily the job of the function name in blocks to tell you what it returns, not necessarily any special UI – in this case, `calculateDistanceBetweenPoints` is stating what it’s doing but not necessarily saying what’s done with the calculation, it might be more clear if the function was instead named something like `distance between two points` – it’s always subtle when picking names, but that’s not significantly different to how all the blocks are written anyways.

[Previous page](https://forum.makecode.com/t/what-does-the-return-0-block-does/3204.md?page=3)
