Ver Mensaje Individual
  #14  
Antiguo 14-07-2014
Avatar de nlsgarcia
[nlsgarcia] nlsgarcia is offline
Miembro Premium
 
Registrado: feb 2007
Ubicación: Caracas, Venezuela
Posts: 2.206
Reputación: 23
nlsgarcia Tiene un aura espectacularnlsgarcia Tiene un aura espectacular
Manuel,

Cita:
Empezado por Manuel
...mi sistema tenía bucle que redimensiona una y otra ves el mismo arreglo dinámico...


Revisa este código:
Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Math;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
   A1 : Array of Integer;
   i,j : Integer;
   Delta : Integer;
   Msg : String;

begin

   Randomize;

   for i := 1 to 1000 do
   begin
      Delta := RandomRange(1,100);
      SetLength(A1,Delta);
      for j := Low(A1) to High(A1) do
         A1[j] := Random(500);
   end;

   ShowMessage('Longitud de A1 = ' + IntToStr(Length(A1)));
   Msg := 'Primer y Último Elemento de A1 = ' + IntToStr(A1[Low(A1)]) + ',' + IntToStr(A1[High(A1)]);
   ShowMessage(Msg);

end;

end.
El código anterior en Delphi 7 bajo Windows 7 Professional x32, redimensiona aleatoriamente en un loop un arreglo de enteros y efectúa operaciones sobre sus elementos.

Suerte en tu proyecto

Nelson.
Responder Con Cita