davidvilla
Member
I was wondering, if Progress treats a FOR EACH with ROWID in the WHERE clause not as a block.
The sample code here is for illustration only. Don't ask me why I used FOR EACH with ROWID even though it is only one record.
I expected the output to print the messages
one
two
three
But, I got, only
one
three
The LEAVE statement actually leaves the procedure, not the FOR EACH block.
If I label the block and leave using the label, it works fine. SO, I think FOR EACH with ROWID is not considered as a block. Progress is smart enough to classify this as a FIND statement even though FOR EACH on a unique condition is used.
Any thoughts??
The sample code here is for illustration only. Don't ask me why I used FOR EACH with ROWID even though it is only one record.
Code:
run pProc1.
message "three" view-as alert-box.
procedure pProc1:
define buffer bfcustomer for customer.
find first customer no-lock.
message "one" view-as alert-box.
for each bfcustomer no-lock where rowid(bfcustomer) = rowid(customer):
leave.
end. /* for each bfcustomer */
message "two" view-as alert-box.
end. /* pProc1 */
I expected the output to print the messages
one
two
three
But, I got, only
one
three
The LEAVE statement actually leaves the procedure, not the FOR EACH block.
If I label the block and leave using the label, it works fine. SO, I think FOR EACH with ROWID is not considered as a block. Progress is smart enough to classify this as a FIND statement even though FOR EACH on a unique condition is used.
Any thoughts??