Conditional Expressions

Future policy editors may include new capabilities. If these new capabilities require revisions to the template file format, older versions of the System Policy Editor will not be able to read the new template files. You can use conditional expressions to ensure that any future template files you create will be compatible with older policy editors.

The System Policy Editor supports two conditional expressions. The first one allows you to include different parts of the template file, based on the version number. This expression has the following syntax.

#if VERSION operator version_number

.

.

.

[#else]

.

.

.

#endif

The operator can be one of the following symbols: >, >=, <, <=, ==, or !=. The version_number can be any integer. For the original template file format released with Windows 95, the version number is 1. Version 2 of the template file format was released with Windows NT version 4.0.

The other conditional expression is #ifdef. This expression has the following syntax.

[#ifdef | #ifndef] keyword

.

.

.

[#else]

.

.

.

#endif

Keywords are implicitly understood by the policy editor. For example, a fictitious company named PolicyCorp might implement its own policy editor that could recognize the POLICYCORP keyword. This company could use the #ifdef and #endif conditional expressions to make sure its template files can be recognized by the Windows System Policy Editor. (Because the Windows System Policy Editor does not currently recognize any keywords, #ifdef always evaluates to FALSE and #ifndef always evaluates to TRUE.)