Sign in Join
Wiki copytemporary

End/fi

Deutsch · English · Français · Suomi · Русский

avainsana end päättää kokonaisuuden. Se esintyy useissa eri paikoissa:

Esimerkiksi:

pascal
procedure proc0;
var
    a, b: integer;
begin
    ???
end;

Pääsääntö on että jokaisen end sanan perässä on oltava puolipilkku. End sanaa edeltävä lause ei vaadi puolipistettä.

Sitä käytetään myös Pascal-moduulin lopettamiseen, jolloin sitä seuraa piste, joka ei siis ole puolipilkku (alla olevassa esimerkissä viimeinen puolipilkku on vapaaehtoinen):

delphi
program proc1;
var
    SL: TStrings;
begin
    SL := TStringlist.create;
    try
        ???
    finally
        SL.free;
    end;
end.

end käytetään ilmaisemaan käännösyksikön (unit) lopun:

pascal
  unit detent;
  uses math;
 
  procedure delta(r:real);
 
  implementation
 
  procedure delta;
  begin
 
  ...
 
  end;
 
  ...
  (* Huomaa: Ei vastaavaa '''begin''' lausetta *)
 
  end.

Se lopettaa record määrittelyn:

pascal
 Type
   ExampleRecord = Record
                     Values: array [1..200] of real;
                     NumValues: Integer; { holds the actual number of points in the array }
                     Average: Real { holds the average or mean of the values in the array }
                   End;

From the Free Pascal wiki, page "End/fi", as it stood on 2022-08-06 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.