FUNC IndexRecNo * *** function to find the 'real' record number when an index (order) is set * *** the trick here is to know the details about rushmore tecknowlegy * *** rushmore only works if 2 things are given: * *** 1. set delete must be off. All records must be accessable for rushmore. * *** 2. the for clause expression must match EXACTLY the index. * *** - i.e.: if the index is set to FistName + LastName you can not just search * *** for a string with the length of the FirstName, you have got to have * *** a string matching the length of the index. LPARA ; TableToCheck LOCAL ; IndexExp, ; IndRecCount, ; CurrIndexValue, ; OldRecNo, ; OldDele, ; OldLock, ; OldSele OldSele = SELECT() IF PCount() = 1 SELE (TableToCheck) ENDIF IndRecCount = 1 IndexExp = KEY() IF IsBlank(IndexExp) * *** no index (order) is set IF BETWEEN(RECNO(), 1, RECCOUNT()) .OR. RECNO() < 0 IndRecCount = RECNO() ENDIF ELSE OldRecNo = RECNO() CurrIndexValue = EVAL(KEY()) OldLock = SET("lock") OldDele = SET('dele') SET DELE ON SET LOCK OFF COUNT ; FOR &IndexExp <= CurrIndexValue ; TO IndRecCount SET DELE &OldDele SET LOCK &OldLock IF BETWEEN(OldRecNo, 1, RECCOUNT()) .OR. OldRecNo < 0 IF OldRecNo <> RECNO() GO OldRecNo ENDIF ELSE GO TOP ENDIF IF TYPE("IndRecCount") <> "N" .OR. IndRecCount = 0 IndRecCount = 1 ENDIF ENDIF SELECT(OldSele) RETURN(IndRecCount) ENDFUNC>I knew somebody would ask for a reason -- I just didn't feel like typing it... :D