function TAddressList.SkipCursor(AQueryParam: string): boolean;
var
BookMark: TBookmarkStr;
begin
with MailDataModule do
if quryMailAddress.Active then
begin
BookMark := quryMailAddress.Bookmark;
quryMailAddress.First;
result := false;
quryMailAddress.DisableControls;
while not quryMailAddress.Eof do
if uppercase(AQueryParam) < uppercase(quryMailAddress.FieldByName('Display').AsString) then
if uppercase(AQueryParam) = uppercase(copy(quryMailAddress.FieldByName('Display').AsString, 1, length(AQueryParam))) then
begin
result := true;
break;
end
else
quryMailAddress.Next
else
break;
if not result then
quryMailAddress.Bookmark := BookMark;
BookMark := '';
quryMailAddress.EnableControls;
end
else
result := false;
end;