To declare a global variable, go into the General section of your code mod
and use a 'public' declaration, i.e.,
Pubic gintX as Integer
However, another way you can do it is to pass the var. This might even be
safer, depending on the way you are using this. Because, realize that a
global will change throughout all subs. And that may not be what you want.
In other words...if the initial value is 5 and you multiple it by 2, then
the value will be reset. So when you later divide that value, you may want
to divide the number 5, but what you may now have is actually the number 10!
What you may really want here is to set a Constant. To do that, you would
set it also in the General declaration section at the top of your code
mod...but you would write it something like this...
Public Const INT_x = 5
Note that my personal naming convention is to make the prefix caps and then
an underscore...which helps me remember throughout my code that this
variable is that of a constant. My naming convention for globals is to add a
small 'g' before the prefix as shown in the global declaration above. Use
whatever works for you, but I strongly suggest you do something consistent
and different when declaring globals and/or setting constant values.