Estimado Colega, si está utilizando un TMemo, le sugiero el siguiente cambio...
Código Delphi
[-]
procedure tform1.Button1Click (sender:tobjet);
var
anios1,anios2,anios3:string;
x,c:Integer;
begin
c:=1
Memo1.Lines.Delimiter:=',';
anios3:=Memo1.Lines.DelimitedText;
with tqueryMotivos do
close;
sql.clear;
sql.add('select anio,Motivo from Motivos where Motivo in '(' + anios3 + ')';
open;
while not IbQueryMotivo.eof do
begin
Stringgrid1.cells[c]:=IbQueryMotivo.FieldByname(anio).AsString;
StringGrid1.Cells[c]:=IbQueryMotivo.FieldByname(Motivo).AsString;
inc(c);
IbQueryMotivo.next;
end;
Saludos cordiales