BEGINS how does it works??

remcoCaesar

New Member
Hi progress people,

The progress documentation says the following over BEGINS:
A BEGINS statement has two references.

My question is:
Which two.

best regards,

Remco Cats
 

TomBascom

Curmudgeon
I don't know what documentation you're looking at but mine says:

BEGINS operator

Tests a character expression to see if that expression begins with a second character expression.

Syntax

expression1 BEGINS expression2

expression1

An expression that has a CHARACTER or LONGCHAR value that you test to see if it begins with expression2.

expression2

An expression that has a character value that you want to compare to the beginning of expression1. If you specify a null value ("") for expression2, the 4GL returns all the records in the database.

So you could code something like:
Code:
if "abc123" begins "a" then
  do:
    /* something */
  end.
 else
  do:
    /* something else */
  end.

More typically it is used in a WHERE clause. As in:

Code:
for each customer no-lock where customer.name begins "Lift":
  display customer.
end.
 

shireeshn

Member
Begins usually we use for two purpose

1) if is exact match ("a" begins "a")
2) if is char begins with ("abc" begins "a")

I think either Tom or mine can answer ur qustion.
 
Top