Previous Next

EQ or = operator
Returns a TRUE value if two expressions are equal.
Syntax 
 
expression { EQ | = } expression 
expression
A constant, field name, variable name, or expression. The expressions on either side of the EQ or = must be of the same data type, although one might be an integer and the other a decimal.
Example 
This procedure prompts for the initials of a sales rep. The FOR EACH block reads all the order records for that sales rep. The DISPLAY statement displays information from each of the retrieved records.
 
PROMPT-FOR Order.SalesRep WITH SIDE-LABELS CENTERED.
 
FOR EACH Order NO-LOCK WHERE Order.SalesRep EQ INPUT Order.SalesRep:
  DISPLAY Order.OrderNum Order.CustNum Order.OrderDate Order.PromiseDate
    Order.ShipDate
    WITH CENTERED.
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 an Unknown value (?) and the other does not, the result is FALSE. If both have the Unknown value (?), the result is TRUE. However, for SQL, if the value of either or both expressions is the Unknown value (?), then the result is the Unknown value (?).
*
*
*
*
You can use EQ 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.