Difference between revisions of "End/fr"

From Lazarus wiki
Jump to navigationJump to search
(Created page with "{{end}} <br> Le mot-clé '''end''' termine un bloc d'instructions commencé par le mot-clé begin ou case, termine la dé...")
 
m (Fixed syntax highlighting)
 
(4 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
Le [[Keyword/fr|mot-clé]] '''end'''  termine un [[Block/fr|bloc]] d'instructions commencé par le mot-clé [[Begin/fr|begin]] ou [[Case/fr|case]], termine la déclaration des [[field/fr|champs]] d'un [[Record/fr|enregistrement]], ou ferme une construction [[Try/fr|try]] .. [[Finally/fr|finally]] or [[Try/fr|try]] .. [[Except/fr|except]].  Il est aussi utilisé pour fermer une [[Unit/fr|unité]] qui n'a pas de code d'initialisation.
 
Le [[Keyword/fr|mot-clé]] '''end'''  termine un [[Block/fr|bloc]] d'instructions commencé par le mot-clé [[Begin/fr|begin]] ou [[Case/fr|case]], termine la déclaration des [[field/fr|champs]] d'un [[Record/fr|enregistrement]], ou ferme une construction [[Try/fr|try]] .. [[Finally/fr|finally]] or [[Try/fr|try]] .. [[Except/fr|except]].  Il est aussi utilisé pour fermer une [[Unit/fr|unité]] qui n'a pas de code d'initialisation.
  
For example:
+
Par exemple:
<syntaxhighlight>
+
<syntaxhighlight lang=pascal>
 
   procedure Proc1;
 
   procedure Proc1;
 
    
 
    
Line 14: Line 14:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
The end statement is one of the exceptions to the rule that every statement must be followed by a semicolon. The statement immediately preceding an end statement does not require a semicolon.
+
L'instruction ''end'' est l'une des exceptions à la règle qui veut que chaque instruction doit être suivie par un point-virgule. En effet, l'instruction précédant exactement l'instruction ''end'' ne requiert pas de point-virgule.
  
It is also used to end a pascal source file, in which case it is followed by a period rather than a [[;|semicolon]] (in the example below, the last semicolon is optional):
+
Il termine aussi un fichier source Pascal, auquel cas il est suivi du point plutôt que du [[;|point-virgule]] (dans l'exemple ci-dessous, le dernier point-virgule est facultatif):
  
<syntaxhighlight>   
+
<syntaxhighlight lang=pascal>   
 
   program Proc2;
 
   program Proc2;
 
   var
 
   var
Line 32: Line 32:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
For a UNIT which contains no initialization, END is used to indicate the end of the unit:
+
Pour une unité sans bloc d'initialisation, END est utilisé pour indiquer la fin de l'unité:
  
<syntaxhighlight>
+
<syntaxhighlight lang=pascal>
 
   unit detent;
 
   unit detent;
 
   uses math;
 
   uses math;
Line 51: Line 51:
 
   ...
 
   ...
 
   
 
   
  (* Note: No '''begin''' statement *)
+
  (* Note: Pas d'instruction '''begin''' *)
 
   
 
   
 
   end.
 
   end.
 
</syntaxhighlight>
 
</syntaxhighlight>
  
It also closes a [[Record|record]]:
+
Il ferme aussi un [[Record/fr|enregistrement]]:
<syntaxhighlight>
+
<syntaxhighlight lang=pascal>
 
  Type
 
  Type
 
   ExampleRecord = Record
 
   ExampleRecord = Record
 
                     Values: array [1..200] of real;
 
                     Values: array [1..200] of real;
                     NumValues: Integer; { holds the actual number of points in the array }
+
                     NumValues: Integer; { tient le nombre actuel de point dans le tableau }
                     Average: Real { holds the average or mean of the values in the array }
+
                     Average: Real { tient la moyenne des valeurs dans le tableau }
 
                   End;
 
                   End;
 
</syntaxhighlight>
 
</syntaxhighlight>
  
{{Keywords}}
+
{{Keywords/fr}}
<br>
 
<br>
 
  
[[category:Pascal]]
+
 
[[Category:Control Structures]]
+
 
 +
[[category:Pascal/fr]]
 +
[[Category:Control Structures/fr]]

Latest revision as of 08:48, 14 February 2020

Deutsch (de) English (en) suomi (fi) français (fr) русский (ru)

Le mot-clé end termine un bloc d'instructions commencé par le mot-clé begin ou case, termine la déclaration des champs d'un enregistrement, ou ferme une construction try .. finally or try .. except. Il est aussi utilisé pour fermer une unité qui n'a pas de code d'initialisation.

Par exemple:

  procedure Proc1;
  
  var a,b: integer;
  
  begin
    (..)
  end;

L'instruction end est l'une des exceptions à la règle qui veut que chaque instruction doit être suivie par un point-virgule. En effet, l'instruction précédant exactement l'instruction end ne requiert pas de point-virgule.

Il termine aussi un fichier source Pascal, auquel cas il est suivi du point plutôt que du point-virgule (dans l'exemple ci-dessous, le dernier point-virgule est facultatif):

   
  program Proc2;
  var
    SL: TStrings;
  begin
    SL := TStringlist.Create;
    try
      (..)
    finally
      SL.Free;
    end;
  end.

Pour une unité sans bloc d'initialisation, END est utilisé pour indiquer la fin de l'unité:

  unit detent;
  uses math;
 
  procedure delta(r:real);
 
  implementation
 
  procedure delta;
  begin
 
  ...
 
  end;
 
  ...
 
 (* Note: Pas d'instruction '''begin''' *)
 
  end.

Il ferme aussi un enregistrement:

 Type
   ExampleRecord = Record
                     Values: array [1..200] of real;
                     NumValues: Integer; { tient le nombre actuel de point dans le tableau }
                     Average: Real { tient la moyenne des valeurs dans le tableau }
                   End;


Mots-clés: begindoelseendforifrepeatthenuntilwhile