Difference between FOR FIRST and FIND FIRST

Cringer

ProgressTalk.com Moderator
Staff member
Maybe if you give us a summary of what you have found so far. We don't tend to like doing homework for others unless they show some sort of initiative. :)
 

TomBascom

Curmudgeon
In both cases the usage of FIRST strongly suggests that the programmer does not really know what they are doing.

You might want to review this: How do I Understand the difference between FOR EACH and FOR FIRST?

FOR FIRST does not do what programmers generally expect it to do and should probably NEVER be used. It is a bug waiting to happen.

While there are a few legitimate uses for FIND FIRST it is also very often bad practice but for different reasons. Especially if you have the habit of automatically adding FIRST to every FIND. The FIND statement is intended to find a single unique record. FIRST is a way of ignoring the fact that your WHERE clause is inadequate, misleading or just plain wrong. Automatically adding FIRST to every FIND shows that you do not have any understanding of your database or your coding techniques. It is the mark of a dangerous amateur programmer.

Yes, you will discover that certain large and well known legacy applications are rife with FIND FIRST. Many people have learned the habit and propagated it from those applications. That does not make it right.
 
Top