
19.09.2008, 18:01
|
 |
Sir Richard Abramson
|
|
Регистрация: 05.04.2008
Сообщения: 5,505
Версия Delphi: XE10
Репутация: выкл
|
|
Цитата:
Сообщение от LDV
Помогите оптимизировать
PHP код:
function Tdatamodule_Connection.EOF: Integer;
begin
if ConnectionStatus = csConnected then
if SelectionStatus = ssByKey then
with cmp_Query_ do begin
try
if not Active then
Open;
Result := Integer(EOF);
except
on E: Exception do
LastMsgError := E.Message;
Result := -1;
end
end
else begin
LastMsgError := const_msg_ErrorSelection
Result := -1;
end
else begin
LastMsgError := const_msg_ErrorConnection;
Result := -1;
end;
end;
|
Код:
function Tdatamodule_Connection.EOF: Integer;
begin
if (ConnectionStatus <> csConnected) or (SelectionStatus <> ssByKey) then
begin
LastMsgError := const_msg_ErrorSelection or const_msg_ErrorConnection;
Result := -1;
Exit;
end;
with cmp_Query_ do
try
if not Active then Open;
Result := Integer(EOF);
except
on E: Exception do
LastMsgError := E.Message;
Result := -1;
end;
end;
|