$$BEGINLOOP and $$ENDLOOP

HomeOverviewsHow Do IDetailsSample

Feature Only in Professional and Enterprise Editions   Creating a Custom AppWizard is supported only in Visual C++ Professional and Enterprise Editions. For more information, see Visual C++ Editions.

$$BEGINLOOP( macro-name );

text

$$ENDLOOP;

Parameters

macro-name

A macro name that you have added to the dictionary with a value that must be a numeric string in decimal format (for example, “12”). The macro-name argument must be the name of a macro, not a constant value.

text

One or more lines of text that may include C++ code, resource script statements, macros, directives, or whatever you parsed.

Remarks

Custom resource templates can use a $$BEGINLOOP and $$ENDLOOP construct to force the CCustomAppWiz::ProcessTemplate function’s parser to process text the number of times specified by the value of macro-name.

The parser treats every macro that it encounters between a $$BEGINLOOP and an $$ENDLOOP, including macro-name, in the following manner:

  1. If, for example, the parser encounters a macro named VAR, it looks in the dictionary for a macro named VAR_n, where n is an integer that corresponds to the number of times that the parser has iterated through text. The iterations are numbered 0, 1, ..., n-1, so that the parser looks for macros named VAR_0, VAR_1, and so on.

  2. If the parser does not find VAR_n in the dictionary, it looks just for VAR.

Loops cannot be nested. A second $$BEGINLOOP before the first $$ENDLOOP is illegal.

See Also   Standard AppWizard Directives, The Dictionary, CCustomAppWiz::ProcessTemplate, Standard AppWizard Directives, How Macros Get Their Values