Progress
Language Tutorial
for Windows


Calculating Values

When you calculate a value, you usually need to save the calculation result. In other words, you need a way to assign a new value to a variable or a field. In Progress, the assignment operator is the equal sign as shown in the following code:

A = 2 + 2. 

When you use the assignment operator in this way, it is a complete Progress statement. Now suppose you need to make several calculations such as those shown in this code:

A = 2 + 2. 
B = A + 10. 
C = A + B. 

You’ve created three Progress statements to perform three calculations. Progress can perform any number of assignments using the ASSIGN statement. This is a partial syntax for the ASSIGN statement.

SYNTAX
ASSIGN [ expression ] ... 

This example recreates the last example using ASSIGN:

ASSIGN A = 2 + 2 
       B = A + 10 
       C = A + B. 

Note that there is only one period—at the end of the last assignment. Using ASSIGN is more efficient than using multiple assignment statements.


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