Inno Setup Preprocessor: #define

Syntax

define-directive: <variable-definition>
<function-definition>
<default-visibility-set>
variable-definition: (define | :) [private | protected | public] <ident> [[ <expr> ]] [[=] <expr>]
function-definition: (define | :) [private | protected | public] <ident> ( [<formal-function-args>] ) <expr>
default-visibility-set: (define | :) private | protected | public
formal-function-args: <formal-function-arg> [, <formal-function-arg>]...
formal-function-arg: <by-val-arg> | <by-ref-arg>
by-val-arg: [<value-type-id>] <ident> [= <expr>]
<func-or-array-type-id> <ident>
by-ref-arg: [<value-type-id>] * <ident>
value-type-id: any | int | str
func-or-array-type-id: func | array

Description

The first syntax ("variable-definition") defines a variable named ident, or assigns a value to an element of an array named ident (use dim instead of define to define the array variable itself). If none of the public, protected, or private keywords are specified, default visibility is assumed.

The second syntax ("function-definition") defines a user defined function named ident. Note:

The third syntax ("default-visibility-set") sets the default visibility of further variable and user defined function definitions in this file. If no visibility declaration occurs in a file, public visibility is assumed by default.

Examples

#define MyAppName "My Program"
#define MyAppExe MyAppName + ".exe"
#define MyAppVer GetVersionNumbersString(MyAppExe)
#define MyArray[0] 15
#define Multiply(int A, int B = 10) A * B

See also

dim, undef, Visibility of Identifiers

User Defined Functions