Autor Beitrag
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Mi 29.12.04 14:24 
Kurze Frage: kann es sein, dass {$DEFINE}-Direktiven nicht global verwendet werden können? Beispielcode:

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:
program dstpclt;

{$DEFINE STANDALONE} //Standalone EXE (non-networking)

uses
  FastShareMem,
  Forms
  {$IFDEF STANDALONE}
  , ClientMain in 'ClientMain.pas' {StandaloneMainForm}
  {$ENDIF};

{$R *.res}

begin
  Application.Initialize;
  Application.Title := 'DSTP Terminplaner 2.0 Client';

  {$IFDEF STANDALONE}
    Application.CreateForm(TStandaloneMainForm, StandaloneMainForm);
  {$ENDIF}

  Application.Run;
end.


Der Code innerhalb der {$DEFINE}-Direktive in ClientMain.pas wird nicht kompiliert:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
...

{$IFDEF STANDALONE}
function SendRequest(Request: String): Integer;
begin
  Result := _SendRequest('127.0.0.1', '$public', Request);
end;
{$ENDIF}

...


AXMD
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: Mi 29.12.04 18:29 
Meinst du sowas wie Projekt\Optionen\Verzeichnisse/Bedinungen -> Defines? Die sind Global für das gesamte Projekt ...

_________________
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.