Autor Beitrag
phantazy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25



BeitragVerfasst: Mo 18.06.07 12:09 
Hey Leute,
bin neu hier und programmiere seit ca. einem Jahr in der Schule und habe jetzt mal privat ein Projekt angefangen. Das ganze soll ein Programm zur archivierung werden jedoch bekomme ich das mit dem Speichern nicht ganz auf die reihe:

Ich habe soweit alles richtig und kann einwandfrei in mein Array schreiben und lesen. Jetzt wollte ich die eingegebenen Daten auch Speichern und habe das ganze nach dieser anleitung gemacht www.dsdt.info/tipps/?id=410 doch er gibt mir immer diese Fehlermeldung:

[Fehler] archiv.pas(123): E1025 Sprach-Feature wird nicht unterstützt: 'typisierte oder untypisierte Datei'


So sieht das ganze bei mir aus:

procedure TForm1.Button4Click(Sender: TObject);
var
F: File of Tdaten;
begin
try
AssignFile(F,'C:\archiv.dat');
ReWrite(F);
Write(F,Datensatz);
finally
CloseFile(F);
end;

Ich bin bestimmt schon seit 2 h in Google und sämtlichen Foren unterwegs und finde keine Antwort und fange langsam an zu verzweifeln.
Also wenn Ihr ne Idee habt was das sein könnte oder wie ich sonst den ganzen kram speichern könnte...ich bin für jede Hilfe dankbar.

Achja Programmiere mit Delphi 2005 PE

Gruß
Daniel
Stefan.Buchholtz
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 612

WIN 2000, WIN XP, Mac OS X
D7 Enterprise, XCode, Eclipse, Ruby On Rails
BeitragVerfasst: Mo 18.06.07 13:14 
Zeig mal wie dein Record definiert ist.

Stefan

_________________
Ein Computer ohne Windows ist wie eine Schokoladentorte ohne Senf.
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mo 18.06.07 13:18 
kein code, kein lösung ;)
phantazy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25



BeitragVerfasst: Mo 18.06.07 13:27 
Das ist jetzt mein record und das array.

TWein = record
art,
preis,
Jahrgang,
Lage,
geschmack,
verfuegbar,
name,
lagerzeit: string [50];
end;
TweinArray = array [0..100] of Twein;
var
i:integer;
wein:Tweinarray;
Form1: TForm1;
Datensatz: twein;
Stefan.Buchholtz
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 612

WIN 2000, WIN XP, Mac OS X
D7 Enterprise, XCode, Eclipse, Ruby On Rails
BeitragVerfasst: Mo 18.06.07 13:34 
Das müsste mit einem file of TWein so wie du es in deinem ersten Post beschrieben hast funktionieren. Als File-Typ musst du den Record verwenden, nicht das array. Weil du in deinem ersten Post andere Typnamen verwendet hast, kann ich jetzt nicht sagen, ob das der Fehler ist.

So sollte es gehen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.Button4Click(Sender: TObject); 
var 
  F : File of TWein; 
  i : Integer;
begin 
  try 
    AssignFile(F,'C:\archiv.dat'); 
    ReWrite(F);
    for i := 0 to anzahlWein do
    begin
      Write(F, wein[i]); 
    end; { for }
  finally 
    CloseFile(F); 
  end; 
end;


Stefan

_________________
Ein Computer ohne Windows ist wie eine Schokoladentorte ohne Senf.
phantazy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25



BeitragVerfasst: Mo 18.06.07 13:42 
Also habs jetzt so mal eingefügt und halt dieses anzahl wein geändert aber ist derselbe Fehler

[Fehler] archiv_graf.pas(112): E1025 Sprach-Feature wird nicht unterstützt: 'typisierte oder untypisierte Datei'

:cry:
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 18.06.07 13:45 
Was steht den in Zeile 112? Schon mit einem packed record versucht?

_________________
Markus Kinzler.
phantazy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25



BeitragVerfasst: Mo 18.06.07 13:48 
In Zeile 112 steht das hier : F : File of TWein;

Wie mach ich das denn mit einem packed Record?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 18.06.07 13:50 
ausblenden Delphi-Quelltext
1:
TWein = packed record ...					

_________________
Markus Kinzler.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 18.06.07 13:51 
Haaalt! Der Code ist schon richtig... :lol:
Aber du hast offenbar ein .NET Projekt gestartet und keins für Win32. .NET unterstützt typisierte Dateien einfach nur nicht... ;-)
phantazy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25



BeitragVerfasst: Mo 18.06.07 13:57 
AH MIST.... hast recht hab .NET projekt gestartet :oops:
ist mein erstes projekt was ich grafisch mache hab einfach mal was geöffnet ^^ was muss ich denn für ein Projekt starteb damit es klappt und kann ich das ganze recht einfach übernehmen oder muss ich komplett neu anfangen?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 18.06.07 14:01 
Du mußt neu anfangen, kannt ja aber den Code manuell rüberkopieren.

_________________
Markus Kinzler.
phantazy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25



BeitragVerfasst: Mo 18.06.07 14:03 
Ok und was muss ich für ein projekt starten will nicht wieder was falsches öffnen ^^
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 18.06.07 14:03 
Du musst "VCL-Formularanwendung - Delphi für Win32" nehmen. Und du musst wahrscheinlich NICHT neu anfangen...
Zunächst entfernst du das neue leere Formular aus dem Programm (Projekt -> Aus dem Projekt entfernen) und fügst dein aktuelles Formular hinzu (Projekt -> Dem Projekt hinzufügen). Dann versuchst du zu kompilieren. Es wird einen Fehler unter uses geben, dort löschst du einfach alles was bemängelt wird (Das sind die Units mit Punkten, z.B. "Borland.Vcl....").
Jetzt speichern und kompilieren und es sollte alles gehen.

Wenn nicht: Kopiere die Oberfläche per Copy&Paste, die Events wie OnClick musst du dann manuell wieder übernehmen.
phantazy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25



BeitragVerfasst: Mo 18.06.07 14:27 
VIELEN DANK :D es klappt alles WUNDERBAR *freu*