Sunday, December 2, 2012

Use of IF THEN

During last week's class, I introduced use of IF THEN.

The correct syntax is

IF condition THEN
     ' BASIC code statements here will      execute when condition
     evaluates to TRUE

ELSE
     ' BASIC code statements here will execute when
     condition evaluates to FALSE

END IF

This decision-making construction may also be nested as in this example

IF a < b THEN
     ' BASIC code statements here
ELSE
     IF a > b THEN

               ' BASIC code statements here
          ELSE
               ' BASIC code statements here
          END IF
END IF