Missing operator or semicolon

Delphi

08/09/2020

Estou com este problema:
Missing operator or semicolon

Aqui está meu código:
procedure TfrmClientes.txtBuscaKeyPress(Sender: TObject; var Key: Char);
begin
  if ((Key in ['0'..'9'] = False) (word (Key) <> VK_BACK)) then
  begin
    ShowMessage('Só é permitido a pesquisa com numeros!');
    Key := #0;
  end;
end;
Guilherme Discher

Guilherme Discher

Curtidas 0

Melhor post

Emerson Nascimento

Emerson Nascimento

09/09/2020

procedure TfrmClientes.txtBuscaKeyPress(Sender: TObject; var Key: Char);
begin
  if (not CharInSet(Key,['0'..'9']) and (ord(Key) <> VK_BACK)) then
  begin
    ShowMessage('Só é permitido a pesquisa com numeros!');
    Key := #0;
  end;
end;
GOSTEI 1

Mais Respostas

Guilherme Discher

Guilherme Discher

08/09/2020

procedure TfrmClientes.txtBuscaKeyPress(Sender: TObject; var Key: Char);
begin
  if (not CharInSet(Key,['0'..'9']) and (ord(Key) <> VK_BACK)) then
  begin
    ShowMessage('Só é permitido a pesquisa com numeros!');
    Key := #0;
  end;
end;

Funcionou, Obrigado pela a ajudá!
GOSTEI 0
POSTAR