insert directive

Inno Setup Preprocessor

insert directive

Syntax

insert-directive: insert <expr>

Description

Changes the insertion point. By default, each line is processed and added to the end of the translation. With insert directive the point at which the translated line is added to the translation can be changed. The directive takes an expression that must evaluate to an integer. The insertion point (specifically: index of a line in translation before which subsequent lines will be inserted) will be set to the number to which expression evaluates. All lines after this directive will be inserted at that insertion point. Insertion point is automatically incremented each time a line is added to the translation, so that each line is inserted after the one previously inserted.

It is not recommended to use script generating functions (such as SetSetupSetting) which may insert a line by themselves, thus shifting a part of the traslation one line down, whereas insertion point is not updated. This may result in different insertion point than expected.

Find built-in function can be used to produce value for the insert directive.

Examples

#insert FindSectionEnd("Icons")
#insert FindSection("Setup") + 1
#insert Find(0, "somefile.ext", FIND_CONTAINS)

See also

append.