The problem is quite simple:
I have a set of records and one of these is the active record.
I perform a find to select a subset of these records.
If the previous active record is in the new found set, I want that it remains the active record.
The only solution I found is to memorize the ID of the actual record; perform the find and then loop to the records until I find it:
$actual_ID = My_Record_ID
Exit Loop if (My_Record_ID = $actual_ID)
Go to record (next; exit after last)
Does anyone have a better and faster solution?