Autor Beitrag
hassedelphi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 101

WIN XP
D7 Enterprise
BeitragVerfasst: So 17.08.03 18:03 
hi

diesen fehler kennen sicher alle. die hilfe und der edh sagen, dass ich meine strings im record fixen soll (string[99]). also tat ich das. hatte aber das gleiche ergebnis. weiß jemand woran's liegt?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
type Taufgaben = record
      aufgabe : array of string[99];
      problem : array of Tstrings;
end;

type Thprojekt = record
       zeitp : tdatetime;
       verzeit : tdatetime;
       ziel : string[99];
       sgrad : integer;
       name : string[99];
       am : Tstrings;
       team : array of Tteams;
end;

_________________
you're not be able to help, that you're an human
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: So 17.08.03 18:47 
da fehlt noch was, ich vermute, du willst die Daten noch in einer typisierten Datei speichern
ausblenden Quelltext
1:
Var dat:file of Taufgaben					

du kannst keine dynamischne arrays in einer typisierten Datei speichern-woher soll Delphi wissen, wieviele Datensätze drin sind.
dazu gehören auch Strings die du auf eine feste länge setzen mußt (also z.B. string[255]) oder auch array müssen statisch sein
ausblenden Delphi-Quelltext
1:
2:
 type Taufgaben = record
      aufgabe : array [1..10] of string[99];

wie sich das mit Tstrings verhält weiß ich nicht, dürfte aber auch nicht gehen,
ansonsten nimm eine untypisierte Datei oder einen Stream und du schreibst dann die Daten selber rein.

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
hassedelphi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 101

WIN XP
D7 Enterprise
BeitragVerfasst: So 17.08.03 18:55 
alles klar thx :)

_________________
you're not be able to help, that you're an human
AndyB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1173
Erhaltene Danke: 14


RAD Studio XE2
BeitragVerfasst: So 17.08.03 23:15 
Keldorn hat folgendes geschrieben:
wie sich das mit Tstrings verhält weiß ich nicht, dürfte aber auch nicht gehen,

Eine Variable/Feld vom Typ TStrings ist nichts anderes als ein Zeiger. Und es wird einem nicht viel bringen, wenn der den Wert des Zeigers in die Datei schreibt.

_________________
Ist Zeit wirklich Geld?
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Mo 18.08.03 07:35 
AndyB hat folgendes geschrieben:
Keldorn hat folgendes geschrieben:
wie sich das mit Tstrings verhält weiß ich nicht, dürfte aber auch nicht gehen,

Eine Variable/Feld vom Typ TStrings ist nichts anderes als ein Zeiger. Und es wird einem nicht viel bringen, wenn der den Wert des Zeigers in die Datei schreibt.

Danke

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)