Autor Beitrag
Samolex
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 22

Win xp
Delphi 5
BeitragVerfasst: Do 08.06.06 17:53 
Hi,

Ich habe seit kurtzem mit borland Delphi 5 angefangen. Vorher habe ich mit Turbo Pascal 7 Programmiert.

Nun will ich gerne wissen, wie mann Eigene Datentypen erstellen kann.

MfG
Samolex


Moderiert von user profile iconjasocul: Topic aus Sonstiges (Delphi) verschoben am Do 08.06.2006 um 18:17

_________________
Wer Rechtschreibfehler findet darf sie behalten. ;-)
Hack Gott
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 409

Windows Vista
Delphi 2005 Personal, Delphi 7
BeitragVerfasst: Do 08.06.06 17:59 
Was willst du genau machen?

Willst du einer Dateiendung ein Programm zuweisen? oder hab ich dich falsch verstanden?

Das kannst du wahlweise in der Registry oder in einem beliebigen Ordner unter Extras->Ordneroptionen Registerkarte Dateitypen machen.

_________________
"Je mehr Käse, desto mehr Löcher; Je mehr Löcher, desto weniger Käse. Daraus folgt: Je mehr Käse desto weniger Käse!"
Samolex Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 22

Win xp
Delphi 5
BeitragVerfasst: Do 08.06.06 18:04 
Hi,

Ich in Turbo Pascal 7 würde dass, was ich machen will so aussehen :

Type Name des Datentyps = Record
s : String;
i : Integer;
...
End;

var Variable : Name des Datentyps;

Also ein Datentyp wie z.B ein String.

MfG
Samolex
Hack Gott
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 409

Windows Vista
Delphi 2005 Personal, Delphi 7
BeitragVerfasst: Do 08.06.06 18:07 
achso, einfach so:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
    Button1: TButton;
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  i: string//jetzt kannst du von überall aus deiner anwendung drauf zugreifen

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var u: string//Jetzt nur in der Button Prozedure
begin

end;

end.

_________________
"Je mehr Käse, desto mehr Löcher; Je mehr Löcher, desto weniger Käse. Daraus folgt: Je mehr Käse desto weniger Käse!"
Samolex Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 22

Win xp
Delphi 5
BeitragVerfasst: Do 08.06.06 18:13 
Nein Nein,

ich meine einen Zusammengesetzten Datentyp. Der Aus Strings,Integers,...,und Chars bestehen kann (also mehrere Datentypen zusammen in einem).

Ewentuell nennt mann das in Delphi Objekt ?

MfG
Samolex
fidionael
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 232

Win XP SP2, Ubuntu 6.06
Delphi 7 PE, Delphi 3 Prof
BeitragVerfasst: Do 08.06.06 18:19 
In Delphi nennt man das Record *gg*

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
type
  Person = record
    Vorname, Name: String;
    Alter: Integer;
  end;
Samolex Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 22

Win xp
Delphi 5
BeitragVerfasst: Do 08.06.06 18:35 
Hi,

Und wo genau muss ich das hinschreiben ? also da, wo ich denke (in Unit1 unter private)
bringt er folgende Fehlermeldung :

',' oder ':' erwartet, aber '=' gefunden

so sieht die entsprechende Quellcodestelle aus..

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
private
    { Private-Deklarationen }
    Personen = Record             { hier entsteht der fehler }
      Vorname, Name : String;
      Alter : Integer;
    end;
puplic


MfG
Samolex

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt
fidionael
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 232

Win XP SP2, Ubuntu 6.06
Delphi 7 PE, Delphi 3 Prof
BeitragVerfasst: Do 08.06.06 18:40 
Einfach ins Interface:

ausblenden Unit1.pas
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TPerson = record
    Name, Vorname: String;
    Alter: Integer;
  end;

  TForm1 = class(TForm)
  private
    Person: TPerson;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

end.
Samolex Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 22

Win xp
Delphi 5
BeitragVerfasst: Do 08.06.06 18:43 
Hi,

Danke jtzt funst das ^^

MfG
Samolex