Autor Beitrag
marvin521993
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 172



BeitragVerfasst: Di 20.02.07 12:08 
Hi,

wie ihr wahrscheinlich wisst, bin ich grad dabei einen vokabeltrainer zu programmieren.

Ich bin auch eigentlich schon fertig, nur leider hab ich in der form, wo die vokabeln abgefragt werden einen fehler.
ich habe ein edit wo eine zeile aus ner txt geladen wird.
doch wie kann ich dann eine Zufalls zeile in das edit feld laden??

meine prozedur:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TVokabfragen.ButtonNaechsteClick(Sender: TObject);
 begin
 randomize;
 EditDeutsch.SetFocus;
   EditEnglisch.Text := daten.Strings[Random(i)];
   EditLoesung.Text := daten.Strings[Random(i+1)];
   LabelLoesung.Caption := '';
   EditDeutsch.Text := '';
 end;


kann mri da jemand helfen?

Mfg
Marvin

Moderiert von user profile iconChristian S.: Titel geändert.

_________________
Marvin Tappert
Besiege einen Feind, und du erhälst 100 Neue!!!!Keine bösen Sprüche bin noch Anfänger
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Di 20.02.07 12:23 
- Randomize; in OnCreate des Forms verschieben;
- Was ist die Variable i?
- Du musst X := Random(I); schreiben und dann auf daten.Strings[X] und daten.Strings[X+1] zugreifen;

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
marvin521993 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 172



BeitragVerfasst: Di 20.02.07 12:27 
daten ist die Tstringlist und i die entsprechende zeile daraus aber danke du hast mir geholfen

Mfg
Marvin

_________________
Marvin Tappert
Besiege einen Feind, und du erhälst 100 Neue!!!!Keine bösen Sprüche bin noch Anfänger
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Di 20.02.07 12:29 
Dann würd ich i mal schleunigst umbenennen. Weißt du nach 1/2 Jahr noch, was i bedeutet?


PS: Schreibfehler in deiner Sig: hältst

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
marvin521993 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 172



BeitragVerfasst: Di 20.02.07 12:31 
oh danke das du mich drauf aufmerksam gemacht hast ;)
aber das mit random(x) geht nich


Mfg
Marvin

_________________
Marvin Tappert
Besiege einen Feind, und du erhälst 100 Neue!!!!Keine bösen Sprüche bin noch Anfänger