Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Type file of? (https://www.delphipraxis.net/29946-type-file.html)

Pseudemys Nelsoni 17. Sep 2004 02:35


Type file of?
 
hi,

ist es irgendwie möglich einen typ zu definieren der ca so aussieht:

Delphi-Quellcode:
type
  TMyFileTyp = file of TMyRec;
?

dizzy 17. Sep 2004 02:43

Re: Type file of?
 
Machs doch einfach genau so :zwinker:.

Pseudemys Nelsoni 17. Sep 2004 02:49

Re: Type file of?
 
geht irgendwie nicht:

Zitat:

[Fehler] TSDataBase.pas(12): Typ 'TDBDataRec' benötigt Finalization - nicht im Dateityp erlaubt
[Fehler] TSDataBase.pas(15): Dateityp ist hier nicht zulässig

dizzy 17. Sep 2004 03:02

Re: Type file of?
 
Das liegt dann daran, dass du Strings oder dynamische Arrays im Record hast. Mit fixen Arrays, ShortStrings und String[länge] gehts problemlos. Drück einfach mal F1 nach der fehlerhaften Kompilierung - die Hilfe äussert sich sehr direkt auf das Problem bezogen ;).

Warum nimmst du nicht nen FileStream? "file of" ist afaik ohnehin bei .NET "depricated". Drüber hinaus sind FileStreams auch recht komfortabel!

\\edit: rechtz schraipunk :drunken:

Pseudemys Nelsoni 17. Sep 2004 03:06

Re: Type file of?
 
stimmt, das mit der hilfe wusste ich nichtmal das die auch die fehler anzeigt *gg*

ich habe nie filestreams benutzt, muss mir ma n tut angucken

danke schonmal :)


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:27 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