Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 26-01-2023
Avatar de MAXIUM
MAXIUM MAXIUM is offline
Miembro
 
Registrado: may 2005
Posts: 1.488
Poder: 20
MAXIUM Va camino a la fama
UnSort StringList

Hola que tal, aquí vengo con problemas

Imaginen un StringList con 3 elementos:
Código Delphi [-]
StringList. Index[0]:= 'Dos';
StringList. Index[1]:= 'Cinco';
StringList. Index[2]:= 'Nueve';

¿Se puede hacer un "UnSort"? Por ejemplo
Código Delphi [-]
StringList. Index[0]:= 'Nueve';
StringList. Index[1]:= 'Dos';
StringList. Index[2]:= 'Cinco';
Responder Con Cita
  #2  
Antiguo 26-01-2023
Avatar de MAXIUM
MAXIUM MAXIUM is offline
Miembro
 
Registrado: may 2005
Posts: 1.488
Poder: 20
MAXIUM Va camino a la fama
Solucionado... Acabo de descubrir la función Exchange()

Código Delphi [-]
Var
   ListaA: TStringList;
   Desde: Integer;
begin
     ListaA:= TStringList.Create;

     For Desde:= 0 to 9 Do
         ListaA.Add(IntToStr(Desde));

     For Desde:= 0 to 9 Do
         ListaA.Exchange(Desde, Random(Desde));

     ListaA.Free;
end;
Responder Con Cita
  #3  
Antiguo 26-01-2023
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.275
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Cita:
Empezado por MAXIUM Ver Mensaje
Imaginen un StringList con 3 elementos:
...
¿Se puede hacer un "UnSort"? Por ejemplo
No se a qué te refieres con un "UnSort".
Si te refieres a ordenralo del revés, los TStringList tienen un Sort/Sorted. Bastaría con que lo recorrieras al revés.

Si te refieres a "mezclarlo", deberás hacerlo manualmente.
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
  #4  
Antiguo 26-01-2023
Avatar de MAXIUM
MAXIUM MAXIUM is offline
Miembro
 
Registrado: may 2005
Posts: 1.488
Poder: 20
MAXIUM Va camino a la fama
Cita:
Empezado por Neftali [Germán.Estévez] Ver Mensaje
No se a qué te refieres con un "UnSort".
Si te refieres a ordenralo del revés, los TStringList tienen un Sort/Sorted. Bastaría con que lo recorrieras al revés.

Si te refieres a "mezclarlo", deberás hacerlo manualmente.
El último código qué puse, resuelve mi problema. Gracias
Responder Con Cita
  #5  
Antiguo 26-01-2023
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.275
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Cita:
Empezado por MAXIUM Ver Mensaje
El último código qué puse, resuelve mi problema. Gracias
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
Respuesta



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
Copiar varias lineas de un stringlist en una sola de otro stringlist Anel Hernandez Varios 3 29-08-2016 22:07:27
Problema con StringList darkone2k4 Varios 7 21-08-2013 19:38:47
Problema con Stringlist Anel Hernandez Varios 5 11-10-2011 21:55:16
Query vs. StringList MaMu Conexión con bases de datos 11 13-03-2008 02:30:53
Limite del StringList victork_py Varios 8 11-05-2004 22:19:11


La franja horaria es GMT +2. Ahora son las 14:32:26.


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