Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > SQL
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 29-03-2012
iFoo iFoo is offline
Registrado
NULL
 
Registrado: nov 2011
Posts: 1
Poder: 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
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Leer texto caracter a caracter kikecg Firebird e Interbase 11 23-11-2010 17:44:44
leer caracter por caracter, una linea de un memo douglas OOP 1 05-10-2007 06:59:31
Stored Procedure con un If después de un Select gluglu Conexión con bases de datos 12 08-08-2007 20:15:46
Ayudaaaa!!! Tabla ASCII: El carácter Ñ vs. carácter ¥ Berto2003 Varios 5 26-07-2005 15:37:48
¿Por qué CommitRetaining funciona después de agregar, pero no después de modificar? Al González Firebird e Interbase 7 16-02-2004 23:47:28


La franja horaria es GMT +2. Ahora son las 15:59:34.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi