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);
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 ?