15.8 Nested Conditionals

Conditionals can be nested inside other conditionals to convey a more complex logical structure to your site. As an example:

version = "standard";
relative_links = "";

if (version == "standard") {
  ifdef (relative_links) {
    /* This block will be executed if
       1) variable `version' equals to "standard" __AND__
       2) variable `relative_links' is defined  */
    print ("Many things made me become a vegetarian, among them,");
    print ("the higher food yield as a solution to world hunger.");
    print ("-- John Denver");
  }
  else {
    // We'll never get here
    print ("We'll never display this ...");
  }
}

Cows' output will be:

Many things made me become a vegetarian, among them,
the higher food yield as a solution to world hunger.
-- John Denver


This manual can be downloaded from http://www.g-cows.org/.