COMPUTE

 

COMPUTE lets you perform mathematical computations.

 

Syntax (Variable data):

 COMPUTE new variable = variable (or record/column) operator variable (or record/column)

 COMPUTE new variable = variable (or record/column) operator value

 

Syntax (ASCII data):

 COMPUTE new variable = record/column operator record/column

 COMPUTE new variable = record/column operator value

 

Abbreviation: COM

 

Usage:

You use the COMPUTE statement to add (+), subtract (-), multiply (*) and divide (/) a variable or series of variables by another variable or a constant. You can create complex expressions using braces. These indicate which expressions should be evaluated together and the order in which they should be considered.

 

The new location is entered to the left of the equal sign. There must be a space before and after the operator. For results with decimal values, WinCross includes as many decimal places as will fit into a specified variable/field; the value is rounded into the last decimal place. Be sure that the width of the variable/field you create is large enough to accommodate the number and its decimal places.

 

COMPUTE examples

 

Related topics:

Glossary Variables