No lo he probado y lo escribo a voleo, pero podrías usar algo asi:
Código Delphi
[-]
procedure MostrarLiterales(MUno, MDos: TMemo; Datos: TDataset);
var
i: Integer;
s: string;
codigo: Integer;
begin
For i := 0 to MUno.Count - 1 do
begin
s := MUno.Lines[i];
codigo := StrToInt(s);
if Datos.Locate('idProducto', codigo, []) then
MDos.Lines.Add(Datos.FieldByName('NOMBRE').AsString);
end;
end;
Un saludo