# Local $variable inside a Single Step button calculation

**URL:** <https://the.fmsoup.org/t/local-variable-inside-a-single-step-button-calculation/3982>\
**Category:** Questions\
**Tags:** calculations\
**Created:** [February 16, 2024, 4:36pm UTC](https://the.fmsoup.org/t/local-variable-inside-a-single-step-button-calculation/3982 "2024-02-16T16:36:57Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Malcolm](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/malcolm/32/196_2.png) [@Malcolm](https://the.fmsoup.org/u/Malcolm)\
**Post date:** [February 18, 2024, 6:21pm UTC](https://the.fmsoup.org/t/local-variable-inside-a-single-step-button-calculation/3982/8 "2024-02-18T18:21:25Z")

</div>

> [@Local variables defined in layout objects live long and travel widely](https://the.fmsoup.org/t/local-variables-defined-in-layout-objects-live-long-and-travel-widely/2870):
>
> [The FileMaker documentation says](https://help.claris.com/en/pro-help/content/using-variables.html?Highlight=variables): When you define a variable, you can specify its scope by adding a prefix before the variable name. Scope Prefix Example Availability function None variableName Only within the function where it is defined local $ $variableName Only within the script where it is defined (not available to sub-scripts); cleared when the script ends global $$ $variableName Anywhere within the file where it is defined; cleared when the file is closed For local (sin…

---

_[View the full topic](https://the.fmsoup.org/t/local-variable-inside-a-single-step-button-calculation/3982)._
