- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
function THandlerServerCommands.CheckCommandOnDigits(const AComand: string;
var AIndex: integer): Boolean;
var
i, k: Integer;
Nn, Ln: integer;
TempComand: string;
begin
Result := False;
try
TempComand := AComand;
Ln := 1;
Nn := 0;
if FServerCommands.Find(TempComand, i) then
begin
AIndex := i;
Result := True;
Exit;
end;
for k := 1 to Length(AComand) do
begin
if not (AComand[k] in ['0'..'9']) then
inc(Nn)
else
begin
inc(Nn);
if Nn > Ln then
begin
TempComand := '';
TempComand := Copy(AComand, 1, Nn - 1);
if FServerCommands.Find(TempComand, i) then
begin
AIndex := i;
Result := True;
Break;
end;
end;
Ln := Nn + 1;
end;
end;
except
on e: Exception do
begin
Result := False;
LogEx.Error('Ошибка в процедуре CheckCommandOnDigits c параметрами AComand = ' + AComand + ' ' + e.Message);
end;
end;
end;