10.3 Global statement

Global <var1> [, <var2>, ...] [= <expr1> [, <expr2>, ...]]

The Global statement is used to tell Hollywood that the specified variable should be global. Additionally, it can also initialize your variable. This statement is only included to improve the readability of your program. You could also leave it out and the code would work the same way. The Global statement works exactly like the Local statement.

If you use the Global statement, it is advised that you place all statements at the beginning of your code. So everyone can clearly see which variables are globally available. Using Global elsewhere in your code is generally not suggested and can be quite confusing to read.

See Global variables for details.

Show TOC