Sign in Join
Wiki copytemporary

period: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: period

OldNewLine
1+## radix mark
2+
3+[[Pascal]] uses the `.` (dot) to separate the integer and fractional part in literal decimal integers.
4+
5+``` pascal
6+myReal := 6.28318
7+```
8+
9+At least one digit in front of the period is mandatory. A `0` integer part must not be omitted.
10+
11+Numbers noted in a non-decimal base can not be noted in that way. E. g. the numeric value “a half” can not be written as `%0.1` ([[Percent sign|%]] being the prefix marking [[Binary numeral system|binary numbers]]).
12+
13+## identifier scope selector
14+
15+For structured data types the dot separates the data structure identifier from its individual components, i. e. methods or data fields.
16+
17+``` pascal
18+program recordDemo(input, output, stderr);
19+
20+uses
21+ Linux;
22+
23+var
24+ info: TSysInfo;
25+begin
26+ if sysInfo(@info) <> 0 then
27+ begin
28+ halt(1);
29+ end;
30+
31+ writeLn('uptime: ', info.uptime, ' seconds');
32+
33+ with info do
34+ begin
35+ writeLn('total free: ', freeram, ' bytes');
36+ end;
37+end.
38+```
39+
40+## range
41+
42+Two consecutive dots `..` let you specify an ordinal [[subrange types|type sub-range]].
43+
44+``` pascal
45+type
46+ signumCodomain = -1..1;
47+```
48+
49+This is the same as [`math.TValueSign`](https://www.freepascal.org/docs-html/rtl/math/tvaluesign.html).
50+
51+## module end
52+
53+The main block of any module, i. e. [[Program|program]], [[Unit|unit]] or [[Library|library]], has to be closed with an [[End|end]] “dot”:
54+
55+``` pascal
56+program hiWorld(input, output, stderr);
57+
58+begin
59+ writeLn('Hi world!');
60+end.
61+```
62+
63+It can be seen as an adoption of natural (written) languages, where a full stop marks an end of a sentence.
64+
65+Anything else after the final `end.`, assuming syntactical correctness, will be ignored by the [[Compiler|compiler]].
66+
67+## namespaces
68+
69+[[Unit]] names containing dots create [[Namespaces|namespaces]].
70+
71+## ASCII value
72+
73+In [[ASCII]], the character code decimal `46` (or [[Hexadecimal|hexadecimal]] `2E`) is defined to be `.` (full stop).
74+
75+---
76+*From the Free Pascal wiki, page "period", as it stood on 2020-07-09 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](/wiki-contact).*
77+Category: Code

Back to history