Information Technology Reference
In-Depth Information
The following code demonstrates the #if...#elif...#else construct. The string contain-
ing the description of the version of the program is set to various values, depending on which
compilation symbol is defined.
#define DemoVersionWithoutTimeLimit
...
const int intExpireLength = 30;
string strVersionDesc = null;
int intExpireCount = 0;
#if DemoVersionWithTimeLimit
intExpireCount = intExpireLength;
strVersionDesc = "This version of Supergame Plus will expire in 30 days";
#elif DemoVersionWithoutTimeLimit
strVersionDesc = "Demo Version of Supergame Plus";
#elif OEMVersion
strVersionDesc = " Supergame Plus, distributed under license";
#else
strVersionDesc = "The original Supergame Plus!!";
#endif
Console.WriteLine( strVersionDesc );
...
Search WWH ::




Custom Search