I need to trigger an error message if the user tries to insert invalid codes into a temporary table in the grid . The codes come from a .txt
. The codes triggered on the monitor are ok but the message is repeated n times as there are n incorrect codes. I would like a single message with the wrong code list to be triggered. How to do this? Thanks.
// procedure para leitura do texto
var
myFile : TextFile;
begin
AssignFile(myFile, arquivoTxt);
Reset(myFile);
while not Eof(myFile) do
begin
ReadLn(myFile, text);
InsereTexto;
end;
CloseFile(myFile);
end;
// procedure para inserir dados do txt no banco
begin
if not qrSELCSPCliente.Locate('CSC_CAP_NroCartao', StrToInt(text), []) then
begin
{INSERE DADOS NO BANCO do txt}
else
begin
MsgAviso('Número já cadastrado!' + text);
end;
end;