Ver Mensaje Individual
  #3  
Antiguo 29-03-2012
iFoo iFoo is offline
Registrado
NULL
 
Registrado: nov 2011
Posts: 1
Reputación: 0
iFoo Va por buen camino
Thumbs up Espero que te sirva

Prueba con esto.

function ParseSQL(textoE: String; delimitador: String): String;
var
fila: Integer;
index: Integer;
delta: Integer;
cadena: String;
textoS: String;
textoTMP: String;
begin
Result := EmptyStr;

fila := 0;
delta := Length(delimitador);
textoS := textoE + delimitador;

try
while Length(textoS) > 0 do
begin
index := Pos(delimitador, textoS);
cadena := Copy(textoS, 0, index - 1);
textoS := Copy(textoS, index + delta, MaxInt);

if (fila > 0) then
textoTMP := textoTMP + cadena + chr(13);

Inc(fila);
end;
finally
Result := textoTMP;
end;
end;

Para utlizar esta función, te doy un ejemplo, dentro de un boton colocas esto:

procedure TForm1.Button1Click(Sender: TObject);
var
textoE: String;
textoS: String;
begin
textoE:= 'CORONA TAVAREZ, RAQUEL EUNICE PEREZ AGUILERA, ANA ERCILIA QUEVEDO RAMIREZ, ESTEBAN';
textoS := ParseSQL(textoE, ',');

ShowMessage(textoS);
end;
Responder Con Cita