Compare [COMPARE]

Compares two strings.

Returns 0 if they are equal

Returns -1 if text1 precedes text2 in alphanumeric order

Returns +1 if text1 comes after text2 in alphanumeric order.

The alphabetical order is case sensitive: a comes before A.

Syntax

COMPARE (“text1”, “text2”)

Note: The required separator (comma or semi-colon) automatically corresponds to your computer’s location settings.

Data Types of the Arguments

String

Data Type of the Result

Integer

Example

Suppose that an element’s FireRating property can have a value from A through F.

If FireRating is A, B or C: it is standard-compliant.

If FireRating is D, E, or F: it is non-compliant.

In this expression, use COMPARE to compare the element’s FireRating category to “C”.

In addition, use an IF function to return one of two strings based on the result of the COMPARE function.

Expression

IF (COMPARE (FireRating, “C”) < 1, “Standard-compliant”, “Non-Compliant”)

If the result is 0, this means that FireRating equals C. This is standard-compliant.

If the result is -1, this means that FireRating comes before C alphabetically: it is either A or B. This is also standard-compliant.

If the result is 1, this means that FireRating comes after C alphabetically: it is either D, E or F. This is non-compliant.

Result

“Standard-compliant” for values of 0 or -1, otherwise “Non-compliant”

  • Was this Helpful ?
  • YesNo
Relevant topics
Model Compare: Review the Changes
After the Compare command is run, the Model Compare window displays the model with colored highlights and other feedback on changes. The Model Compare palette is docked at the left edge of this window (this palette cannot be moved). Note: By default, the Model Compare palette lists ...
Compare Two Views of a Single Project
This workflow is recommended e.g. to compare two views in a single ARCHICAD project. For example, compare two different 3D views of the existing vs. proposed site plan. 1.Use Design > Model Compare. 2.From the Model Compare palette: Select Current model for both Model 1 and Model ...
Compare Views of Structural Analytical Models
Here, you will compare views of the Structural Analytical Model (not the Physical Model). Therefore, before running Model Compare, you must enable the Structural Model in the “Select View” dialog, as described below. Note: When you open a SAF file using Model Compare, the SAF ...