findstate-tt

FIND statement [name] defined without qualifier [ FIRST | LAST | NEXT | PREV | CURRENT ]


Rule "findstate-tt" gives this warning when it finds a "FIND" statement without [ FIRST | LAST | NEXT | PREV | CURRENT ] and has no 'IF AMBIGUOUS' statement immediately following.


This rule only looks at temp-tables. Database tables are inspected by rule "findstate"

The risc:

If the FIND statement returns more than one record an error will occur when an attempt to access the record is made. Also, if not already searching on an Unique index, without the qualifier the PROGRESS engine will look to see if there is another record that matches the criteria increasing the search time. However, even in the case of searching on an Unique index, it is better coding practice to add the qualifier as it indicates to other developers what your intent is.


Known issue:

The IF AMBIGUOUS statement may not directly follow the find statement but it could be in the code before the record is accessed.


How to solve this:

Make a habit of adding IF AMBIGUOUS immediately after the find statement.


How to suppress these warnings: