AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Bekomm das mit den Records nicht hin?

Ein Thema von EMS · begonnen am 19. Dez 2012 · letzter Beitrag vom 28. Dez 2012
 
EMS

Registriert seit: 19. Dez 2012
97 Beiträge
 
#10

AW: Bekomm das mit den Records nicht hin?

  Alt 19. Dez 2012, 12:30
Hallo
bin jetzt nen Programm weiter und neues Problem...

Delphi-Quellcode:
 unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs;

type

  { TForm1 }

  TForm1 = class(TForm)
    procedure Button1Click(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

type
  TZiel = record
    Ort: String;
    Preis: real;
  end;
type
  TZielliste = record
  Ziele: array[1..100] of TZiel;
  ZielZahl: integer;
 end;

TZielFile = file of TZiel;

var
  Form1: TForm1;
  ZielListe: TZielliste;
  ZielFile: TZielfile;
  I: integer;


implementation

{$R *.lfm}

{ TForm1 }

procedure ZieleErfassen(var Liste: ZielListe);
begin
  with Liste do begin
    Ziele[1].Ort:='Dresden';
    Ziele[1].Preis:=16.00;
    with Ziele[2] do begin
      Ort := 'Berlin';
      Preis := 43.00;
    end;
  with Ziele[3] do begin
     Ort :='Aachen';
     Preis := 155.00;
  end;
  ZielZahl :=3;
  end;
end;

begin
ZieleErfassen(ZielListe);
Assign(Zielfile, 'C:\Users\Notebook\Desktop\ziele.dat');
Rewrite(Zielfile);
with ZielListe do
   for I := 1 to ZielZahl do
      write(ZielFile, Ziele[I]);
   Close(ZielFile);
end;

end.

Wo ist denn jetzt schon wieder der Fehler?
Irgendwie weiß ich nicht so recht wo das
TZielFile = file of TZiel hin muss?
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:04 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