function TRepSparseList.ForAll(ApplyFunction: Pointer): integer; var itemP: PAnsiChar; Item: Pointer; i, callerBP: Cardinal; j, Index: integer; begin Result := 0; i := 0;
asm mov eax,[ebp] mov callerBP,eax end;
while (i < SlotsInDir) and (Result = 0) do begin itemP := SecDir^[i]; if itemP <> nil then begin j := 0; index := i shl cnSecShift; while (j < cnSecSize) and (Result = 0) do begin Item := PPointer(itemP)^; if Item <> nil then asm mov eax,index mov edx,item push callerBP call ApplyFunction pop ecx mov @Result,eax end;
type TSPAApply = function(index: integer; item: pointer);
Function TRepSparseList.ForAll( ApplyFunction: Pointer {TSPAApply} ):Integer; Var itemP: PPointer; i: Cardinal; j, index: Integer; Begin Result := 0; i := 0; While ( i < slotsInDir ) And ( Result = 0 ) Do Begin itemP := secDir^[i]; If itemP <> Nil Then Begin j := 0; index := i Shl SecShift; While ( j < FSectionSize ) And ( Result = 0 ) Do Begin If itemP^ <> Nil Then begin result := TSPAApply(ApplyFunction)(index,itemP^.Ptr); end; Inc( itemP ); Inc( j ); Inc( index ) End End; Inc( i ) End; End;
----------------------------------------------
-