Pedron,
Cita:
...estoy buscando es que me imprima en un memo2 todos los datos que sean diferentes al arreglo...ejemplo...HOLA DB HOLA...guarde...HOLA HOLA...
|
Revisa este código:
Código Delphi
[-]
procedure TForm1.Button2Click(Sender: TObject);
var
SL: TStringList;
i, j, k : Integer;
Token : String;
AuxStr : String;
begin
SL := TStringList.Create;
Memo2.Clear;
for i := 0 to Memo1.Lines.Count - 1 do
begin
AuxStr := Memo1.Lines[i];
for j := 1 to Length(AuxStr) do
begin
if (AuxStr[j] <> ' ') and (AuxStr[j] <> ',') then
Token := Token + AuxStr[j]
else
begin
SL.Add(Token);
Token := EmptyStr;
end
end;
SL.Add(Token);
Token := EmptyStr;
for j := SL.Count - 1 downto 0 do
for k := Low(RegAsm) to High(RegAsm) do
if SL[j] = RegAsm[k] then
SL.Delete(j);
for j := 0 to SL.Count - 1 do
Token := Token + SL[j] + ' ';
Memo2.Lines.Add(Token);
Token := EmptyStr;
SL.Clear;
end;
SL.Free;
end;
El código anterior en Delphi 7 y Windows 7 Professional x32,
analiza cada línea de TMemo1, las compara tipo Case Sensitive con un arreglo y copia dicha línea a TMemo2 eliminando cualquier ocurrencia encontrada.
Espero sea útil
Nelson.