# Scope of $variable in Let statement in Calculated Field

**URL:** <https://the.fmsoup.org/t/scope-of-variable-in-let-statement-in-calculated-field/3155>\
**Category:** Questions\
**Tags:** scripting, variables\
**Created:** [October 19, 2022, 6:52pm UTC](https://the.fmsoup.org/t/scope-of-variable-in-let-statement-in-calculated-field/3155 "2022-10-19T18:52:19Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![harvest](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/harvest/32/231_2.png) [@harvest](https://the.fmsoup.org/u/harvest)\
**Post date:** [October 20, 2022, 4:45am UTC](https://the.fmsoup.org/t/scope-of-variable-in-let-statement-in-calculated-field/3155/10 "2022-10-20T04:45:53Z")

</div>

reminds me of this thread:

> [@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 (si…

---

_[View the full topic](https://the.fmsoup.org/t/scope-of-variable-in-let-statement-in-calculated-field/3155)._
