Registriert seit: 22. Mär 2005
Ort: Dingolfing
4.129 Beiträge
Turbo Delphi für Win32
|
Re: Vokabeltrainer
23. Nov 2005, 20:28
Sonstige Fragen zu Delphi wäre ganz gut gewesen. Das machst übrigens am besten mit Records:
Delphi-Quellcode:
type
TVocabulary=record
Englisch, German: String[20]
end;
...
Delphi-Quellcode:
var vocabularies: array of TVocabulary;
procedure StoreVocabulary(Vocabulary: TVocabulary);
begin
setlength(vocabularies,length(vocabularies+1));
vocabularies[high(vocabularies)]:=Vocabulary;
end;
procedure SaveVocabulariesToFile(Filename: String);
var f: file of TVocabulary;
I: Cardinal;
current: TVocabulary;
begin
assignfile(f,filename);
rewrite(f);
for I:=0 to high(vocabularies) do
begin
current:=vocabularies[i];
write(f,current);
end;
closefile(f);
end;
[edit=Sharky]Delphi-Tags für den zweiten Codeblock gesetzt. Mfg, Sharky[/edit]
Manuel Eberl „The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.“
- Terry Pratchett
|