Autor Beitrag
bocky3 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Mo 05.09.05 19:28 
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
unit Unit1;

interface

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

const max = 7;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Button2: TButton;
    ListBox1: TListBox;
    Edit2: TEdit;
    Button3: TButton;
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;



type Tklasse = record  drache : string[20];    // rzeugen des types
                  mensch : string[20];
                  untoter : string[20];
                  zwerg : string[20];
                  daemon : string[20];
                  elf : string[20];
                  ork : string[20];
               end;




var
  Form1: TForm1;
  k: Array[1..7of Integer;
  x : integer;
  klasse : array[1..7of Tklasse;   // array mit dem record (habt ihr das gemeint? )
  
  implementation

{$R *.dfm}

procedure TForm1.Button3Click(Sender: TObject);
var i : integer;
begin
for i := 1 to max do
  begin
  klasse.drache := (edit1.text);      // Fehlermeldung nummer 1
  end;
end;

procedure TForm1.Button2Click(Sender: TObject);
var z,j :integer;
label jump;
begin
randomize;
for x := 1 to max do
   begin
    jump:
    z:=random(7)+1;
    for j:=1 to x-1 do if z = k[j] then goto jump;
    k[x]:=z;

    edit2.text := (klasse.drache);    // Fehlermeldung nummer 2
    listbox1.items.add(IntToStr(k[x]));
   end;
end;


end.


wie kann ich die 2 arrays miteinander verbinden, sodass ich jedem type ne nummer zugewiesen hab und ihn so in der position verändern kann, soweit das möglich ist?
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Mo 05.09.05 20:09 
Bitte mache für eine neue Frage ein neues Thema auf.

Gruß
Klabautermann
bocky3 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Mo 05.09.05 21:29 
dachte mr, dassso was kommt.^^
kk, ich machne neuen thread.^^