Bonjour,
quel est l'équivalent du #IFDEF du C, et où le définir ?
Merci
Bonjour,
quel est l'équivalent du #IFDEF du C, et où le définir ?
Merci
$IFDEF , non ?
![]()
![]()
L'urgent est fait, l'impossible est en cours, pour les miracles prévoir un délai. :bug: ___ "http://club.developpez.com/regles/#LIII-A"Écrivez dans un français correct !!
C++Builder 5 - Delphi 6#2 Entreprise - Delphi 2007 Entreprise - Delphi 2010 Architecte - Delphi XE Entreprise - Delphi XE7 Entreprise - Delphi 10 Entreprise - Delphi 10.4.2 Entreprise - Delphi 11.3 Entreprise - Visual studio 2022
OpenGL 2.1 - Oracle 10g - Paradox - Interbase (XE) - PostgreSQL (15.7)
Pour définir les instructions de compilation, utilises un fichier .INC (Include) dans lequel tu ajoutes par exemple ce qui suit :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 {$DEFINE ACTIVEDEVELOPMENT} { Activer / Desactiver le mode developpement. } {$IFDEF ACTIVEDEVELOPMENT} {$DEFINE NOWAITING} { Suspend l'affichage de la page de demarrage. } {.$ELSE} { Récupère les instructions $IFDEF sans $ELSE. } {$ENDIF} { ------------------------------------------------------------------------------ Principe: Un point au debut des accolades desactive une instruction. Exemple: (.$DEFINE ) Plusieurs instruction peuvent etre imbriquees dans le fichier include. Observation: Le compilateur ne compile que les parties actives du programme. Desactivation = Allegement du fichier .exe. ------------------------------------------------------------------------------ }
puis dans ton source tu déclares le fichier et défini les instructions par exemple comme suit :
program Copromaf;
{$I Copromaf.INC}
uses
Forms,
CopromafPrincipale in 'CopromafPrincipale.pas' {Principale},
.......
......
{$R *.RES}
begin
Application.Initialize;
Application.Title := 'Copromaf v1.0 - Logiciel de gestion.';
Application.HelpFile := '..\Aide\hlp\COPROMAF.HLP';
{$IFDEF NOWAITING}
Application.CreateForm(TPrincipale, Principale);
{$ELSE}
Attente := TAttente.Create(Application);
Attente.Show;
while not (Attente.AccessAuthorized) do
begin
Attente.Update;
Application.ProcessMessages;
if Attente.AccessAuthorized then begin
if not (Attente.AccessCancel) then
Application.CreateForm(TPrincipale, Principale);
Break;
end;
end;
{$ENDIF}
Application.Run;
end.
Bon développement.
http://www.egri.co.uk/smileys/walk.gif http://www.developpez.com/delphi/delphihlp.htm
- Delphi Studio 7 Architecte.
- Interbase / SQL Server 2000 / Oracle 9i
- Windows (2000 Famille Server, 98, Me, XP Professionnel).
http://www.egri.co.uk/smileys/walk.gif http://www.developpez.com/delphi/delphihlp.htm
- Delphi Studio 7 Architecte.
- Interbase / SQL Server 2000 / Oracle 9i
- Windows (2000 Famille Server, 98, Me, XP Professionnel).
Partager