Autor Beitrag
Jacdelad
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 109

Win XP Pro
Borland Developer Studio 2006 Architect
BeitragVerfasst: Do 13.09.07 12:59 
Ich hab mal wieder ne ganz einfach, blöde Frage:

Wie kann ich in Delphi eine Include-Datei einbinden?

In XProfan schreibe ich einfach "$I Include.inc" und im Programm ist es dann als würde der Inhalt der Datei an genau der Stelle stehen. Aber wie geht das in Delphi??

Jac

_________________
Es gibt 10 Arten von Menschen: Die einen, die Binärcode verstehen und die, die es nicht tun.
alex517
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 60


D7Ent, FB, FIBPlus
BeitragVerfasst: Do 13.09.07 13:31 
Hi,

ausblenden Delphi-Quelltext
1:
{$I Dateiname}					
oder
ausblenden Delphi-Quelltext
1:
{$INCLUDE Dateiname}					

alex
Jacdelad Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 109

Win XP Pro
Borland Developer Studio 2006 Architect
BeitragVerfasst: Do 13.09.07 13:32 
Danke!

_________________
Es gibt 10 Arten von Menschen: Die einen, die Binärcode verstehen und die, die es nicht tun.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 13.09.07 20:27 
Zub beachten ist dabei aber, dass alle Anweisungen innerhalb der Include-File sich auf den gleichen Anweisungs-Block beziehen müssen.
Du kannst also nicht in einer Include-File die in einer Prozedur zu deklarierenden Variablen schreiben und dann

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
Procedure Foo;
{$I 'vars.inc'}
Begin
    Bar;
end;


schreiben. Wenn Du Zeile 1 und 2 vertauscht, geht's, hat dann aber ne andere Bedeutung.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.