10.7 Constants

Constants, as the name implies, are values which cannot be changed after their first initialization. They can be accessed through a user-specified name but their values are fixed during the script's execution. Like all language elements, Hollywood does not distinguish between lower and upper case constants, but they should be written in capitals for style guide reasons. Constants also need to have a hash character (#) prefix to distinguish them from variables. The constants True and False are exceptions here, they do not need to have a hash character prefix because they are elementary parts of the Hollywood script language. All other constants are just additions for commands and therefore need to be prefixed.

Constants must be either numbers or strings. You can also declare your own constants by using the Const statement, for example:

 
Const #MYCONSTANT = 5 * 5

If you use this statement, you should always use it at the beginning of your script because it is a global declaration which cannot be changed during your script's execution.


Show TOC