Previous Next

NE or <> operator
Compares two expressions and returns a TRUE value if they are not equal.
Syntax 
 
expression { NE | <> } expression 
expression
A constant, field name, variable name, or expression. The expressions on either side of the NE or must be of the same data type.
Example 
This procedure displays information for all items that appear in the catalog. (The CatPage field is not equal to the Unknown value (?) or 0.)
 
FOR EACH Item NO-LOCK WHERE Item.CatPage <> ? AND Item.CatPage <> 0:
  DISPLAY Item.ItemNum Item.ItemName Item.CatPage
    WITH TITLE "Catalog Items" USE-TEXT.
END.
Notes 
*
By default, the AVM uses the collation rules you specify to compare characters and sort records. The collation rules specified with the Collation Table (-cpcoll) startup parameter take precedence over a collation specified for any database the AVM accesses during the session, except when the AVM uses or modifies pre-existing indexes. If you do not specify a collation with the -cpcoll startup parameter, the AVM uses the language collation rules defined for the first database on the command line. If you do not specify a database on the command line, the AVM uses the collation rules with the default name "basic" (which might or might not exist in the convmap.cp file).
*
If one of the expressions has the Unknown value (?) and the other does not, the result is TRUE. If both have the Unknown value (?), the result is FALSE. For SQL, however, if one or both expressions have the Unknown value (?), then the result is the Unknown value (?).
*
*
*
*
*
You can use NE to compare a LONGCHAR variable to another LONGCHAR or CHARACTER variable. The variable values are converted to -cpinternal for comparison and must convert without error, or the AVM raises a run-time error.
*

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.