Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Relational operators in PowerBuilder – PB Docs 125 – PowerBuilder Library

Relational operators in PowerBuilder – PB Docs 125

Relational operators in PowerBuilder

Description

PowerBuilder uses relational operators in boolean expressions
to evaluate two or more operands. Logical operators can join relational
expressions to form more complex boolean expressions.

The result of evaluating a boolean expression is always true or false.

The following table lists relational and logical operators.

Table 4-2: PowerBuilder relational and logical operators

Operator

Meaning

Example

=

Equals

if Price=100
then Rate=.05

>

Greater than

if Price>100
then Rate=.05

<

Less than

if Price<100
then Rate=.05

<>

Not equal

if Price<>100
then Rate=.05

>=

Greater than or equal

if Price>=100
then Rate=.05

<=

Less than or equal

if Price<=100
then Rate=.05

NOT

Logical negation

if NOT Price=100
then Rate=.05

AND

Logical and

if Tax>3 AND
Ship <5 then Rate=.05

OR

Logical or

if Tax>3 OR
Ship<5 then Rate=.05

Usage

Comparing strings

When PowerBuilder compares strings, the comparison is case
sensitive. Trailing blanks are significant.

For information on comparing strings regardless
of case, see the functions Upper and Lower.

To remove trailing blanks, use the RightTrim function.
To remove leading blanks, use the LeftTrim function.
To remove leading and trailing blanks, use the Trim function.
For information about these functions, see RightTrim, LeftTrim,
and Trim.

Decimal operands

Relational operators that operate on numeric values (including =, >, <, <>, >=,
and <=) can take decimal operands. The precision of
the decimal operand is maintained in comparisons.

Null value evaluations

When you form a boolean expression that contains a null value,
the AND and OR operators behave
differently. Thinking of null as undefined (neither true nor false)
makes the results easier to calculate.

For more information about null values,
see “NULL values “.

Examples

Case-sensitive comparisons

If you compare two strings with the same text but different
case, the comparison fails. But if you use the Upper or Lower function,
you can ensure that the case of both strings are the same so that
only the content affects the comparison:

Trailing blanks in comparisons

In this example, trailing blanks in one string cause the comparison
to fail:

Logical expressions with null values

In this example, the expressions involving the variable f,
which has been set to null, have null values:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x