Relational Operators

From Recital Documentation Wiki
Revision as of 16:01, 5 July 2011 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The following Relational Operators are supported in the Recital/4GL:


Operator Operation
= Equal To
== Exactly Equal To / Matches Pattern
<> Not Equal To
!= Not Equal To
# Not Equal To
> Greater Than
>= Greater Than or Equal To
< Less Than
<= Less Than or Equal To
$ Substring is Contained In
| Contains Substring


The Relational Operators are always evaluated from left to right.

The following ’wildcard’ characters can be used for == pattern matching:


Character Action
? Matches any one character
% Matches any one character
* Matches zero or more characters


In SQL statements, the following wildcard characters are available:


Characters Description
_ Matches any one character
% Matches zero or more characters


Note: For FoxPro compatibility reasons, wildcard pattern matching is not available when SET COMPATIBLE is set to FOXPRO/FOXBASE/FOXPLUS/VFP.


Example

cSTR1 = [Welcome to the Recital/4GL]
? "Recital" $ cSTR1
.T.
 
cSTR2 = [Welcome]
// Compares to the end of cSTR2
? cSTR1 = cSTR2
.T.
 
// Compare contents & size
? cSTR1 == cSTR2
.F.