ya hice lo que me dijiste caral
pero me da un problema con el delete es que no me borra los tres caracteres que le pido?? que estoy haciendo mal o que me falta??
Código SQL
[-] if frm_DataModule.qry_AluMat_APM.RecordCount <> 0 then
begin
while not (frm_DataModule.qry_AluMat_APM.eof) do
begin
cadena := frm_DataModule.qry_AluMat_APM.Fields[1].AsString;
compara := Length(trim(cadena ));
y := 1;
for x := 0 to compara do
begin
tres := copy( cadena,y, 3 );
y := y + 3;
if tres = VarToStr(combo_Materia.KeyValue) then
begin
inc(z);
Delete(cadena, y-3, 3);
ListBox1.Items.Add(frm_DataModule.qry_AluMat_APM.Fields[0].AsString);
frm_DataModule.qry_AluMat_APM.next ;
if z = 1 then
frm_DataModule.qry_AluMat_APM.next ;
end;
end;
end; //while end