End/fi
Deutsch · English · Français · Suomi · Русский
avainsana end päättää kokonaisuuden. Se esintyy useissa eri paikoissa:
- merkitä moduulin lopun, eli esim. ohjelma, käännösyksikkö (unit) tai library
- merkitä lohkon tai ohjeistuksen lopun
- sulkea joitakin kielirakenteita:
- if … then … end tai
- Case … of …
endrakenteen lopetus, mutta myös - try … except … finally … end (poikkeukset)
- lopettaa tietyt type määrittelyt, kuten object, record ja class
Esimerkiksi:
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):
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:
unit detent;
uses math;
procedure delta(r:real);
implementation
procedure delta;
begin
...
end;
...
(* Huomaa: Ei vastaavaa '''begin''' lausetta *)
end.Se lopettaa record määrittelyn:
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.