next up previous contents index
Next: Loops Up: Declaring variables Previous: Declaring variables   Contents   Index


Local and global variables

As we shall see later, variables declared with my exist only for a certain area (scope) or your program. Sometimes though you may wish to have a global variable, which is visible throughout your program. There are at least two ways to do this: