Ver Mensaje Individual
  #2  
Antiguo 06-03-2016
Avatar de Lepe
[Lepe] Lepe is offline
Miembro Premium
 
Registrado: may 2003
Posts: 7.424
Reputación: 28
Lepe Va por buen camino
Hay dos formas, o usas ExtractStrings (mira en la ayuda el uses)

O un TStringList;
Código Delphi [-]
var
  st : TstringList; 
begin 
  st := TstringList.Create; 
  st.Delimiter := '-'; 
  st.DelimitedText:= 'pc-12345-a-16'; 
  if st.Count > 0 then  edit1.text := st[0]; 
  if st.Count > 1 then  edit2.text := st[1]; 
  if st.Count > 2 then  edit3.text := st[2]; 
  if st.Count > 3 then  edit4.text := st[3]; 
  finally 
    st.Free; 
  end;
end;

No lo he compilado... pero debe funcionar.
He puesto los "if" porque nunca me fío de los datos que pueda haber en la base de datos.

Saludos.
__________________
Si usted entendió mi comentario, contácteme y gustosamente,
se lo volveré a explicar hasta que no lo entienda, Gracias.
Responder Con Cita