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

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 31-12-2015
JuanOrtega JuanOrtega is offline
Miembro
NULL
 
Registrado: sep 2011
Posts: 130
Poder: 13
JuanOrtega Va por buen camino
gracias por la ayuda ecfisa , lo que estoy haciendo es limpiar repetidos en arrays of string , el codigo que tengo hasta ahora es este :

Código Delphi [-]
type
  otro_array = array of string;

function clean_array(const array1: array of string): otro_array;
var
  array_limpio: otro_array;
  i: integer;
  i2: integer;
begin
  For i := Low(array1) to High(array1) do
  begin
    For i2 := Low(array_limpio) to High(array_limpio) do
    begin
      if (array_limpio[i2] = array1[i]) then
      begin
        SetLength(array_limpio, Length(array_limpio) + 1);
        array_limpio[Length(array_limpio)] := array1[i];
      end
    end;
  end;
  Result := array_limpio;
end;

procedure TForm1.Button1Click(Sender: TObject);
const
  datos: array [1 .. 5] of string = ('test1', 'test2', 'test3',
    'test4', 'test5');
var
  arrays: Array Of String;
  array_limpio: otro_array;
  i: integer;
begin

  SetLength(arrays, 5);

  arrays[0] := 'test1';
  arrays[1] := 'test2';
  arrays[2] := 'test1';
  arrays[3] := 'test4';
  arrays[4] := 'test1';

  array_limpio := clean_array(arrays);
  // clean_array(arrays);

  For i := Low(array_limpio) to High(array_limpio) do
  begin
    ShowMessage(array_limpio[i]);
  end;

Creo que pense el tema muy mal porque mi funcion clean_array() no devuelve ni detecta nada , ¿ que hice mal ?
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
Es una buena practica? Diego827 PHP 15 21-08-2012 21:35:52
Teoria y Practica jcarteagaf Humor 0 18-08-2008 16:32:34
Sobre la práctica de corregir posts rcarrillom Debates 9 19-03-2008 06:32:06
Ayuda con una práctica YoDonald Lazarus, FreePascal, Kylix, etc. 1 03-03-2005 09:38:02
la practica hace al maestro ¿verdad? perudelphi OOP 1 06-12-2004 09:51:59


La franja horaria es GMT +2. Ahora son las 17:49:29.


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