Progress
Language Tutorial
for Windows


Evaluating Conditions

You can think of a conditional expression as an expression that Progress ultimately evaluates to either TRUE or FALSE. Conditional expressions make up the heart of conditional branching statements, like the IF statement and the CASE statement. (You’ll learn about conditional statements in the next chapter.) The conditional expression is the test that determines how a conditional statement branches. Conditional expressions do not make up separate statements, but are usually part of another statement. Here are some examples using the IF statement:

/*1*/  IF A = 2 + 2 THEN . . . 
/*2*/  IF B > A THEN . . . 
/*3*/  D = B > A. 

These notes explain the code:

  1. It appears at first that there is an assignment embedded in the IF statement. Actually, it is a conditional expression. Read the statement like this: Is the current value of A equal to 2 plus 2? The result is either YES or NO—TRUE or FALSE.
  2. This second expression uses the greater than operator: Is B greater than A?
  3. This example is a statement, not a conditional expression. Here, you are assigning the result of the B > A test to a LOGICAL variable named D.

Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095