paxCompiler/help/pascal_script_classes.htm
Dalibor Marković 9d0de424e8
Init
Signed-off-by: Dalibor Marković <dalibor31@gmail.com>
2024-07-06 22:28:12 +02:00

50 lines
1.3 KiB
HTML

<html>
<head>
<link rel=stylesheet type="text/css" href="styles.css">
</head>
<body>
<H2>
Pascal samples. Script-defined class types.
</H2>
<hr>
<blockquote>
<pre>
<font color="blue"><b>uses</b></font>
Classes;
<font color="blue"><b>type</b></font>
TMyComponent = <font color="blue"><b>class</b></font>(TComponent)
<font color="blue"><b>procedure</b></font> Show; <font color="blue"><b>virtual</b></font>; <font color="blue"><b>abstract</b></font>;
<font color="blue"><b>end</b></font>;
TMyClass = <font color="blue"><b>class</b></font>(TMyComponent)
<font color="blue"><b>procedure</b></font> Show; <font color="blue"><b>override</b></font>;
<font color="blue"><b>end</b></font>;
<font color="blue"><b>procedure</b></font> TMyClass.Show;
<font color="blue"><b>begin</b></font>
writeln(<font color="Red">'TMyClass'</font>);
<font color="blue"><b>end</b></font>;
<font color="blue"><b>var</b></font>
X: TMyComponent;
<font color="blue"><b>begin</b></font>
X := TMyClass.Create(<font color="blue"><b>nil</b></font>);
X.Name := <font color="Red">'abc'</font>;
writeln(X.Name);
X.Show;
X.Free;
<font color="blue"><b>end</b></font>.
</pre>
</blockquote>
<p>
<HR>
<font size = 1 color ="gray">
Copyright &copy; 2006-2009
VIRT Laboratory. All rights reserved.
</font>
</body>
</html>