IDE Window: Codetools Defines Editor/fr

From Free Pascal wiki
Jump to navigationJump to search

Deutsch (de) English (en) français (fr)

Copie d'écran

configuration->Éditeur de directives des outils de code...

EditeurDirectiveOutilsCode.png

Important

Ces valeurs ne sont utilisées que par les outils de code(codetools), pas par le compilateur. Pour configurer les chemins de recherche utiliser les options de l'environnement, les options du compilateur, Les éditeurs de paquets et l'inspecteur de projet. L'IDE crée automatiquement des nœuds codetools pour ces valeurs.

Cette boite dialogue est principalement destinée au débogage, quand les outils de code analysent différemment du compilateur. Ou pour installer les sources Delphi dans l'IDE Lazarus.

Introduction

Les outils de code fournissent des fonctions pour analyser les sources pascal - FreePascal, Delphi, Kylix. Pour trouver les sources pascal ils ont besoin des chemins de recherche et pour analyser les IFDEFs ils ont besoin des drapeaux(flags) de compilation. Ces valeurs sont définies par des règles - les modèles de définition.

Pour chaque répertoire les outils de code gèrent un ensemble de valeurs. Cela signifie que chacune des unités dans un répertoire partagent les mêmes valeurs (chemins et drapeaux). C'est pourquoi vous devriez uniquement mettre deux projets / paquets dans un répertoire s'ils utilisent les mêmes paramètres. On the other hand this system allows to handle an arbitrary number of distinct sources at the same time. For example you can have Delphi and FreePascal sources. The Delphi sources will use the Delphi system.pas, while the FPC sources will use the FPC system.pp. Or you can have two different FPC versions. Or several FPC cross sources (For example for linux and windows). You do not need to restart the IDE or recompile anything for that. Note: The compiler of course can only handle one type of sources.

This dialog allows to explore and edit the define templates.

All values and variables can contain macros. A variable with an empty value is still defined. That means 'IFDEF variable' will still result in 'true'. To purge a variable use 'Undefine'.

Block

This node type exists only to group nodes.

Directory

To create nodes only valid for a specific directory use this node type. The child nodes are only parsed for the directory specified in Value. Define and Undefine nodes will set/clear variables only for this directory, not for the sub directories. To set/clear variables for sub directories, create a child node of type Directory or use the Define Recurse, Undefine Recurse.

Define

Sets a flag/value for the current directory. Examples:

  • Set Name to 'Def1'. Now IFDEF Def1 will be true and in source a {$IFDEF Def1} will be parsed by the codetools.
  • Set Name to 'Def1' and Value to '123'. Same as above, but addionally IF Def1=123 gives true.
  • Set Name to 'Def1' and Value to '$(Def1);bogus'. This will append ';bogus' to the value of Def1.

Define Recurse

Same as Define, but for the current directory and all sub directories.

Undefine

Purges a variable form the current set of definitions.

Undefine Recurse

Same as Undefine, but for the current directory and all sub directories.

Undefine All

Same as Undefine Recurse, but purges all variables. Useful for directories that build their own world. For example the FPC source.

IfDef

If the Variable is defined the child nodes are executed.

IfNDef

If the Variable is not defined the child nodes are executed.

If

Executes the expression in Value and if the result is '1' then the child nodes are executed. The syntax is the same as the compiler. For example 'defined(avariable)' returns '1' if the avariable is defined, otherwise '0'. Examples:

  • Set 'Value' to 'defined(linux) and defined(i386)'
  • To check for a specific FPC version: 'VER2_0 or VER2_2'. The variables will be replaced by their values. Empty or not defined values result in '0'.
  • To compare the values of two variables use: '$(#TargetOS)'='$(#SrcOS)'. IMPORTANT: If you forget the apostrophes, the following will happen: First the macros will be replaced, which results in linux=unix, which is further replaced by the values of the variables: 1=1, which always results to true.

ElseIf

If all former If resulted in false, then the ElseIf or Else node is executed. The ElseIf is the same as an Else If.

Else

If all former If or ElseIf resulted false, then this node is executed.

Menu

Exit - Save and Exit

Save changes and close dialog.

Exit - Exit without Save

Discard changes and close dialog.

Edit - Move node up

Move selected node in front of next upper sibling.

Edit - Move node down

Move selected node below next lower sibling.

Edit - Move node one level up

Move selected node to parent node.

Edit - Move node one level down

Make selected node a child of the previous sibling.

Edit - Insert node below

Create a new node and insert it below selected node.

Edit - Insert node as child

Create a new node and insert it as child of selected node.

Edit - Delete node

Delete selected node.

Edit - Convert node

Change type of selected node.

Tools - Open Preview

Open the Codetools Directory Values.

Insert Template

Create a new node from the templates and insert it below selected node.

Treeview

Select a node and view the details below.

Selected node

Name

Description

Value

Value as Text

Shows the value.

Values as File Paths

Splits the value for semicolons and shows each path on a separate line.