69 lines
1.3 KiB
HTML
69 lines
1.3 KiB
HTML
<html>
|
|
<head>
|
|
<link rel=stylesheet type="text/css" href="styles.css">
|
|
</head>
|
|
<body>
|
|
<H2>
|
|
Pascal samples. Units.
|
|
</H2>
|
|
<hr>
|
|
|
|
|
|
<blockquote>
|
|
|
|
<pre>
|
|
<font color="blue"><b>unit</b></font> MyUnit;
|
|
<font color="blue"><b>interface</b></font>
|
|
<font color="blue"><b>var</b></font>
|
|
I: Integer = 4;
|
|
<font color="blue"><b>const</b></font>
|
|
S = <font color="Red">'abc'</font>;
|
|
|
|
<font color="blue"><b>procedure</b></font> Proc(X: Integer);
|
|
|
|
<font color="blue"><b>implementation</b></font>
|
|
|
|
<font color="blue"><b>var</b></font>
|
|
J: Integer = 10;
|
|
|
|
<font color="blue"><b>procedure</b></font> Proc(X: Integer);
|
|
<font color="blue"><b>begin</b></font>
|
|
writeln(X);
|
|
<font color="blue"><b>end</b></font>;
|
|
|
|
<font color="blue"><b>initialization</b></font>
|
|
writeln(<font color="Red">'Initialization'</font>);
|
|
I := 10;
|
|
<font color="blue"><b>finalization</b></font>
|
|
writeln(<font color="Red">'finalization'</font>);
|
|
|
|
<font color="blue"><b>end</b></font>.
|
|
</pre>
|
|
</blockquote>
|
|
|
|
Main program:
|
|
|
|
<blockquote>
|
|
|
|
<pre>
|
|
<font color="blue"><b>program</b></font> Demo;
|
|
<font color="blue"><b>uses</b></font> MyUnit;
|
|
<font color="blue"><b>begin</b></font>
|
|
writeln(I);
|
|
writeln(S);
|
|
Proc(123);
|
|
<font color="blue"><b>end</b></font>.
|
|
</pre>
|
|
</blockquote>
|
|
|
|
|
|
|
|
<p>
|
|
<HR>
|
|
<font size = 1 color ="gray">
|
|
Copyright © 2006-2009
|
|
VIRT Laboratory. All rights reserved.
|
|
</font>
|
|
</body>
|
|
</html>
|