![]() |
Inhalt vom Type Cardinal in eine Datei speichern ?
Ich möchte den Inhalt vom Type Cardinal in eine Datei speichern. Wie geht man da vor? Eine Umwandlung als String oder Integer geht nicht .
|
Re: Inhalt vom Type Cardinal in eine Datei speichern ?
Eine Möglichkeit wäre
Delphi-Quellcode:
Diesen File-Typ sprichst du an wie den normalen File-Typ auch. Noch besser wäre allerdings
var MyFile: file of Cardinal;
![]()
Delphi-Quellcode:
var F: TFileStream;
F := TFileStream.Create(MyFileName, fmOpenReadWrite); // speichern F.Position := 0; F.Write(MyCardinal, sizeof(Cardinal)); // lesen F.Position := 0; F.Read(MyCardinal, sizeof(Cardinal)); // am Ende freigeben nicht vergessen! F.Destroy; |
Re: Inhalt vom Type Cardinal in eine Datei speichern ?
Vielen Dank für Deine schnelle und umfassende Antwort.
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:22 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz