The following is an event handler for a button that navigates backward through a table:

PROCEDURE prevButton_onClick

   if .not. bof( ) 

      skip -1 

   endif 

   if bof( ) 

      msgbox( "First record", "Navigation", 64 ) 

   endif 

This example demonstrates an atypical programming construct: instead of using IF and ELSE, there is an IF statement for a condition, followed by a separate IF statement for the opposite condition. In this case, it works like this: if you are already at BOF( ) you do not want to attempt to navigate backwards, because that will cause an error. But if you end up at BOF( ), or if you’re already at BOF( ), then you will get a message.