Autor Beitrag
SuperDaniel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: So 15.04.07 16:51 
keine ahnung wie ich das beschreiben soll

ausblenden 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:
var
  Form1: TForm1;
  zahl: integer;
  key1: string;
  key2: string;
  key3: string;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
zahl := 1;
key1 := 'Test 1';
key2 := 'Test 2';
key3 := 'Test 3';
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
form1.Caption := key + zahl;
zahl := zahl + 1;
end;


ich möchte das wenn ich den button drücke jeweils die richtige Variabl ausgelesen wird, nur hab ich da keine ahnung wie das gehen soll
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: So 15.04.07 16:56 
Gibt es mehrere Buttons, oder wie wird entschieden, welche Variable die richtige ist?

_________________
Markus Kinzler.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8553
Erhaltene Danke: 479

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 15.04.07 16:59 
Nimm statt der einzelnen Strings ein Array of String.

_________________
We are, we were and will not be.
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 15.04.07 17:11 
Oder eventuell auch..
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
Caption:=Key;
case Zahl of
  1:Key:='Test 1';
  2:Key:='Test 2';
  3:Key:='Test 3';

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
SuperDaniel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: So 15.04.07 17:48 
dank euch

das von Blackheart666 klappt super