AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Dynamisches Array

Ein Thema von Lotus · begonnen am 2. Sep 2010 · letzter Beitrag vom 2. Sep 2010
 
Benutzerbild von rapante
rapante

Registriert seit: 3. Jun 2009
Ort: OPR
172 Beiträge
 
Delphi 12 Athens
 
#35

AW: Dynamisches Array

  Alt 2. Sep 2010, 19:23
versuchs mal so, dann ersparst du dir auch die globale Variable...
Delphi-Quellcode:
unit test;

interface

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

type
  TMyArray = array[0..3] of integer;

  TForm1 = class(TForm)
    Memo1: TMemo;
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure fill_array(var ta: TMyArray; wert:integer);
var i:integer;
begin
for i:=low(ta) to high(ta) do
ta[i]:=wert;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
  i:integer;
  MyArray: TMyArray;
begin
fill_array( myArray,2);
for i:=low(myarray) to high(myarray) do
Form1.Memo1.Text:=Form1.Memo1.Text+ ' ' +(inttostr(myArray[i]));
end;

end.
Micha
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:07 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz