Autor Beitrag
LonghornUser
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Di 21.08.07 16:28 
Hallo,

ich habe hier im Forum gelesen, dass man per "Compilerschalter" gewisse Teile des Quelltextes weglassen bzw. Hinzufügen kann. Wie funktioniert sowas ?
Das wäre sehr hilfreich, denn ich programmiere sonst eigentlich zweigleisig (Demo/Vollversion).
So eine Funktion würde mir das erleichtern. Einfach Haken rein und schon macht er den Vollversionscode raus.

Danke schonmal.

Ciao LHUser
arj
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 378

Win XP/Vista, Debian, (K)Ubuntu
Delphi 5 Prof, Delphi 7 Prof, C# (#Develop, VS 2005), Java (Eclipse), C++, QT, PHP, Python
BeitragVerfasst: Di 21.08.07 16:50 
das ist relativ einfach:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
{$IFDEF demoversion}
ShowMessage('Demo');
{$ELSE}
ShowMessage('Vollsversion');
{$ENDIF}


Dann musst du nur noch vorher (zum Beispiel im dpr-File) ein:
ausblenden Delphi-Quelltext
1:
{$DEFINE demoversion}					

schreiben, dann baut er ne Demoversion.
Wenn du die Anweisung weglässt oder zum Beispiel einfach ein Leerzeichen vor das Dollar, dann wird ne Vollversion gebastelt.

Du kannst den Compilerschalter demoversion auch dann in die Projekteinstellungen irgendwo eintragen.
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Di 21.08.07 17:03 
Coooool. Danke !!
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Di 21.08.07 17:25 
Und der ausgeklammerte Code ist dann in der fertigen EXE gar nicht drin, oder ?
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Di 21.08.07 18:01 
Genau.

_________________
If liberty means anything at all, it means the right to tell people what they do not want to hear. - George Orwell