This means that if you have a string variable -- and which aren't exactly constant anyway), I'm referring here to "real" constants you define yourself in your [Code]. They're handy if you want to follow rule 4 above (avoiding magic numbers), and also for rule 3 (avoiding duplication). The reason for doing this is because these values all share the same namespace with each other (and with other constants), and so you can get a clash quite quickly.
When working with enumerations (above) and arrays (below) in particular, you can get quite complicated constructs for your variable types.
However, you may find that they're easier to keep track of if you put them immediately above the routines that use them. See also the section, as that shows a way to do a mix of both. One is the familiar single-line comment, which starts at the comment marker and continues until the end of the line.
Printable version of this article Firstly, please note that I'm just another user of Inno Setup, not one of its developers.
To the best of my knowledge, information contained in this article was correct at the time it was written, but it's possible that it contains errors, or that an upgrade to Inno has rendered something mentioned here unnecessary or incorrect.
Global variables are considered a "code smell" -- ie.
something that makes your code smell bad, and thus should be used as little as possible.
Hashed characters can be concatenated with each other and with quoted strings without having to use the the first non-space character on the line. ), or it may be completely nonsensical to put "5" in there, or to be able to multiply it. In fact, you may want to use an enumeration even for something that's two-state -- you may be able to give it a more meaningful name that way (rule 1).
If it is, then the line will get misinterpreted as an ISPP directive. Strings, unlike arrays (which we'll cover later), use a one-based index. The above snippet illustrates a Pascal convention: giving each alterative a prefix from the initials of its parent type or variable.This is intended as an aide, rather than anything definitive I'm expecting you to be using Inno Setup 5.Some of the material covered here is also applicable to IS4, but for most of the cooler stuff you need IS5.In fact, some of the material is applicable to any sort of programming, not only Inno Setup scripts. I'm also expecting you to be reasonably familiar with programming, if not Pascal specifically.This isn't a programming tutorial -- while I will be covering some of the syntax of Pascal, I won't cover much of the semantics -- you're expected to have some basic programming knowledge already The most important thing to bear in mind at all times is that your code needs to be readily understandable.Since ROPS (Inno's scripting language) doesn't support classes, however, you'll find that to do anything nontrivial, a certain amount of global variables are required.