Skip to end of banner
Go to start of banner

If-Else Example 5

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

number monthNumber = month(currentDate());
string monthName = formatDate(currentDate(), "MMMM");
number [] longMonths = {1,3,5,7,8,10,12};

if(arrayElementExists(longMonths, monthNumber)) {
    runnerLog("Example 5: There are 31 days this month.");
} else if(monthNumber == 2) {
    runnerLog("Example 5: There are 28 or 29 days this month. Who knows...");
} else {
    runnerLog("Example 5: There are 30 days this month.");
}
  • No labels