Autor Beitrag
Viper
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 88



BeitragVerfasst: So 14.07.02 12:31 
Hallo,

ich möchte gern ein dynamisches Array speichern, dazu aber kein Ini-File benutzen!
Kann ich das auch irgendwie in einem FileStream realisieren und wie müsste ich es wenn anstellen?

Gruß
Viper
Pit
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 160



BeitragVerfasst: So 14.07.02 16:35 


Zuletzt bearbeitet von Pit am Sa 05.10.02 07:36, insgesamt 1-mal bearbeitet
Viper Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 88



BeitragVerfasst: So 14.07.02 16:42 
Titel: kleines Beispiel?
Hi,

könntest du vielleicht mal ein kleines, einfaches Beispiel dafür machen?

Gruß
Viper
Pit
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 160



BeitragVerfasst: So 14.07.02 17:30 
Titel: Re: kleines Beispiel?


Zuletzt bearbeitet von Pit am Sa 05.10.02 07:36, insgesamt 1-mal bearbeitet
Viper Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 88



BeitragVerfasst: Mo 15.07.02 14:27 
Titel: Danke!!!
Hi,

danke für das Beispiel, dass bringt mich doch ein ganzes Stück weiter!!!

Gruß
Viper
Pit
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 160



BeitragVerfasst: Mo 15.07.02 16:26 
Titel: Re: Danke!!!


Zuletzt bearbeitet von Pit am Sa 05.10.02 07:36, insgesamt 1-mal bearbeitet
Viper Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 88



BeitragVerfasst: Mo 15.07.02 18:27 
Pit hat folgendes geschrieben:

Ich warte immer noch darauf, daß du mal den ElementTyp postest (falls kein StandardType inklusive der Deklaration).

Das Programm soll für ein Turnier werden und da muss ich verschiedene Informationen für beliebig viele Spieler speichern. In etwa so:
ausblenden Quelltext
1:
2:
3:
4:
5:
type TSpielerInfo = record
  Name: string;
  Punkte: integer;

type TSpieler = array TSpielerInfo;

Vielleicht muss ich noch andere Infos über die Spieler speichern, dass steht noch nicht ganz fest, aber ich denke das müsste doch über eine Schleife zu realisieren sein, oder?

Gruß
Viper
Eisenherz
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48



BeitragVerfasst: Mo 15.07.02 18:31 
Hi Viper,

vielleicht hilft Dir auch dieses kleine Stream-Tutorial weiter. Darin wird zufällig gezeigt, wie man ein dynamisches Array speichern kann.

_________________
aloa Eisenherz
Pit
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 160



BeitragVerfasst: Mo 15.07.02 20:18 


Zuletzt bearbeitet von Pit am Sa 05.10.02 07:37, insgesamt 1-mal bearbeitet
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Di 16.07.02 08:39 
@Viper:

Mach aus deinem String einen ShortString. Der lässt sich nämlich so in den Stream drücken.

Es ist nicht anzunehmen, daß mehr als 255 Zeichen für einen Namen verwendet werden, oder? :D

Cu,
Udontknow
Viper Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 88



BeitragVerfasst: Di 16.07.02 09:02 
Hallo,

ich kann es im Moment nicht ausprobieren, da ich in der Schule bin, habe mir das Tutorial aber schon durchgelesen.
Hätte nie gedacht das Streams eine so komplirzierte Sache sind!

Gruß
Viper
Pit
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 160



BeitragVerfasst: Di 16.07.02 14:14 


Zuletzt bearbeitet von Pit am Sa 05.10.02 07:37, insgesamt 1-mal bearbeitet
Pit
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 160



BeitragVerfasst: Di 16.07.02 14:26 


Zuletzt bearbeitet von Pit am Sa 05.10.02 07:37, insgesamt 1-mal bearbeitet
Eisenherz
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48



BeitragVerfasst: Di 16.07.02 14:47 
Pit hat folgendes geschrieben:
@Richard: Da ist noch ein Definitionsfehler in der Einleitung drin, du solltest das Verfahren des Streaming von der konkreten Implementierung als VCL-TStream-Klassenhierarchie trennen.

Stimmt, bei meiner Einleitung könnte der Eindruck aufkommen, dass Streaming zwingend bedeute die VCL-Stream-Klassen zu verwenden.
Ich werde es ändern.

_________________
aloa Eisenherz
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Di 16.07.02 15:52 
Mein Fehler. Fasste auch eine Definition alla string[30] als Shortstring auf.
Also, in diesem Falle dann immer 30 Byte. Das lässt sich meiner Meinung nach verkraften.

Cu,
Udontknow
Pit
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 160



BeitragVerfasst: Di 16.07.02 16:43