Conditionals

The if/else statement evaluates a Boolean expression to decide between two alternative actions.

if (x > 0) {

  reg = event.region;

}

else {

  reg = event.firstRegion;

}

The “else if” construct allows you to test additional cases, similar to the Switch Statement.

var day = CALC.weekdayname(CALC.today())

 

if (day == 'Thursday') {

  Text1.text = 'Note: ' + day + ' hours are 10am-4pm.';

}

else if (day == 'Friday') {

  Text1.text = 'Note: ' + day + ' hours are 10am-12pm.';

}

else if (day == 'Sunday') {

  Text1.text = 'Note: ' + day + ' office closed.';

}

else {

  Text1.text = 'Note: ' + day + ' hours are 9am-5pm.';

}

<< Arrays © 1996-2013 InetSoft Technology Corporation (v11.4) For Loop >>