# Variable question

**URL:** <https://forum.xojo.com/t/variable-question/71908>\
**Category:** Getting Started\
**Created:** [August 24, 2022, 5:58am UTC](https://forum.xojo.com/t/variable-question/71908 "2022-08-24T05:58:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![André\_van\_Haren](https://forum.xojo.com/user_avatar/forum.xojo.com/andr%C3%A9_van_haren/32/1980_2.png) [@André\_van\_Haren](https://forum.xojo.com/u/Andr%C3%A9_van_Haren)\
**Post date:** [August 24, 2022, 5:58am UTC](https://forum.xojo.com/t/variable-question/71908/1 "2022-08-24T05:58:59Z")

</div>

I understand that a variable only is seen within a Method, and that if I need a variable that can be seen in all methods I should make it a property. However a property still is only seen within the Window where it is placed. How can I make a variable that can be seen on all Windows?

---

<div class="post-metadata">

**Author:** ![Torsten\_Bernhard](https://forum.xojo.com/letter_avatar_proxy/v4/letter/t/b9e5f3/32.png) [@Torsten\_Bernhard](https://forum.xojo.com/u/Torsten_Bernhard)\
**Post date:** [August 24, 2022, 6:02am UTC](https://forum.xojo.com/t/variable-question/71908/2 "2022-08-24T06:02:12Z")

</div>

Putting it in a module makes it globally available.

---

<div class="post-metadata">

**Author:** ![André\_van\_Haren](https://forum.xojo.com/user_avatar/forum.xojo.com/andr%C3%A9_van_haren/32/1980_2.png) [@André\_van\_Haren](https://forum.xojo.com/u/Andr%C3%A9_van_Haren)\
**Post date:** [August 24, 2022, 6:17am UTC](https://forum.xojo.com/t/variable-question/71908/3 "2022-08-24T06:17:17Z")

</div>

Thanks! That’s why it looks like a globe 🙂

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [August 24, 2022, 7:40am UTC](https://forum.xojo.com/t/variable-question/71908/4 "2022-08-24T07:40:33Z")

</div>

Do not forget the scope (for variables declared in Modules):  
 ![image](https://forum.xojo.com/uploads/default/original/2X/c/cbc906d6aa07cc0279baf92d781ebbd544193a2a.png)

Also, a variable declared in a block exists only in that block:

```auto

If foo Then
Dim fam As Integer // Exist only here
// other code
End If

```

You can check that by yourself in putting a break before, inside and after the If block and watch for fam in the debugger…

---

<div class="post-metadata">

**Author:** ![André\_van\_Haren](https://forum.xojo.com/user_avatar/forum.xojo.com/andr%C3%A9_van_haren/32/1980_2.png) [@André\_van\_Haren](https://forum.xojo.com/u/Andr%C3%A9_van_Haren)\
**Post date:** [August 25, 2022, 4:22am UTC](https://forum.xojo.com/t/variable-question/71908/5 "2022-08-25T04:22:39Z")

</div>

thanks!
