# Function parameters in general

**URL:** <https://community.thunkable.com/t/function-parameters-in-general/2340551>\
**Category:** Questions about Thunkable X\
**Tags:** function\
**Created:** [March 24, 2023, 1:45am UTC](https://community.thunkable.com/t/function-parameters-in-general/2340551 "2023-03-24T01:45:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 24, 2023, 1:45am UTC](https://community.thunkable.com/t/function-parameters-in-general/2340551/1 "2023-03-24T01:45:03Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/2/02da212d8d59252f75ba2e3e88d32b259e674fe2.jpeg)

This photo comes from this [video](https://m.youtube.com/watch?v=VNFfW5NQlPo&t=667)

I’m just curious why use function parameters at all?  
Why not avoid the function to begin with and just place the concatenation, as in the screen shot I provided, into the label to save code?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [March 24, 2023, 4:50am UTC](https://community.thunkable.com/t/function-parameters-in-general/2340551/2 "2023-03-24T04:50:13Z")

</div>

That’s not a great example of using a function to simplify code. I’d say it’s fine either way.

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 24, 2023, 11:43am UTC](https://community.thunkable.com/t/function-parameters-in-general/2340551/3 "2023-03-24T11:43:52Z")

</div>

What is a good argument for function parameters?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [March 24, 2023, 11:47am UTC](https://community.thunkable.com/t/function-parameters-in-general/2340551/4 "2023-03-24T11:47:56Z")

</div>

The most obvious answer to me is that a function should handle repetitive code by reducing the number of blocks needed.

So if I find myself re-using a set of blocks, I might make it into a function. Or if I need to run those blocks over and over with different input values, I might make it into a function.

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 24, 2023, 12:11pm UTC](https://community.thunkable.com/t/function-parameters-in-general/2340551/5 "2023-03-24T12:11:01Z")

</div>

Not the function itself, the parameters.

What is the significance of having them?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [March 24, 2023, 12:15pm UTC](https://community.thunkable.com/t/function-parameters-in-general/2340551/6 "2023-03-24T12:15:19Z")

</div>

Parameters allow you to run the same function multiple times with different inputs.

Let’s say I wanted to take an image url stored in Cloudinary, convert it so that the image is cropped and scaled and set to a lower file size as well, and then share that url in an email message using an API to send it. I could make the url the parameter of the function that does all of that and for any image I wanted to run through that process, I could just call the function block with that image’s url.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [June 22, 2023, 12:15pm UTC](https://community.thunkable.com/t/function-parameters-in-general/2340551/7 "2023-06-22T12:15:52Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
