Autor Beitrag
dany
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Mo 08.09.03 13:23 
Hi,

ich habe eine Delphi-Konsolenanwendung. In

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
program Project1

uses Unit1 in Unit1.pas, Unit2 in Unit2.pas;

begin
  start(); //def. in Unit1 
end;


in Uni2 habe ich eine Klasse def.
ausblenden Delphi-Quelltext
1:
class = blabla					


in Unit1 var XX: von Klasse in Unit2

wenn ich jetzt eine Indstanz der Klasse bilden möchte, beendet sich mein Programm. Im Dos-Fenster sehe ich noch ganz kurz eine Fehlermeldung. Selbst beim Debuggen passiert genau das selbe. Die Fehlermeldung kann ich nicht sagen. Auch das das Programm sofort geschlossen wird ohne weiteren Code auszuführen finde ich merkwürdig. Weiß jemand rat?

dany

Moderiert von user profile iconKlabautermann: Delphi-Tags hinzugefügt.
Moderiert von user profile iconTino: Titel geändert & Topic verschoben.

_________________
Wenn du den Kopf in den Sand steckst, kuckt dein Hinterteil immer noch raus.
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mo 08.09.03 13:42 
Ein bisschen mehr Code wäre eventuell hilfreich (vor allem der der Klasse und wie du sie erstellst)... :roll:

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
dany Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Mo 08.09.03 14:08 
Titel: Der Code
ausblenden 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:
Unit1

procedure Start();
procedure Anfang();
//procedure Ende();



implementation


var meineKlasse: K1;



procedure Start();
begin;
  WriteLn( 'ann' );
  Anfang();
  WriteLn( 'end' );
  //Ende();

end;



procedure Anfang();
begin
  meineKlasse.Datei_Init( 'Name1' );
end;



ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
Unit2

type K1 = class
private
  str_Name: string;
public
  procedure Datei_Init( str_N: string );
end;


implementation


procedure K1.Datei_Init( str_N: string );
begin
  str_Name := str_N;
end;



mehr ist es nicht. Die Fehlermeldung kommt nach str_Name := str_N; Ich glaube es hat was damit zu tun das es eine Konsolenanwendung sein soll.

dany


Moderiert von user profile icontommie-lie: Delphi-Tags hinzugefügt

_________________
Wenn du den Kopf in den Sand steckst, kuckt dein Hinterteil immer noch raus.
barfuesser
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 324



BeitragVerfasst: Mo 08.09.03 14:31 
Für eine ordentliche Fehlermeldung starte mal das Programm direkt auf der Konsole. Ansonsten solltest Du erst einmal Deine Klasse erzeugen, bevor Du sie verwendest.
ausblenden Delphi-Quelltext
1:
meineKlasse := K1.Create;					

barfuesser
dany Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Mo 08.09.03 14:36 
Titel: Sorry
genau das war's. Heute ist wohl nicht mein Tag :D

_________________
Wenn du den Kopf in den Sand steckst, kuckt dein Hinterteil immer noch raus.
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mo 08.09.03 14:47 
Und nicht vergessen auch wieder freigeben! Und auch nen Resource-Schutzblock...

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!