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é...")
 
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>
 
   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 à règle qui veut que chaque instruction doit être suivie par un point-virgule. 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>   
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>
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>
 
  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>

Revision as of 09:09, 8 July 2014

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 à règle qui veut que chaque instruction doit être suivie par un point-virgule. 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;


Keywords: begindoelseendforifrepeatthenuntilwhile