-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathtest.pas
94 lines (75 loc) · 1.6 KB
/
test.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
unit test;
(* JCF CLI test file *)
interface
uses CRT;
type
IFace = interface
['{5E3C2BCA-56C8-46DE-959F-338AF5F69C1A}']
procedure proc;
end;
type TMyType = class
[Subscribe]
protected procedure proce(var params: TParams);
end;
implementation
procedure myProcedure;
var s: String;
begin
s := 'this is a string';
writeln(s);
end;
function myFunction(aParam: string
; aParam2: real): boolean;
var i: integer;
begin
var inline_var_decl := 777;
var inline_var_decl2, inline_var_decl3: string;
var inline_var_decl5, inline_var_decl6 := 888;
var inline_var_decl2_string, inline_var_decl3_string: string := 'this is a string';
const inline_const := 999;
for var currentField in fieldList do
begin
var inline_var_decl4: string = 'a string';
end;
for i := 1 to 10 do
if i < 10 then write(i, ',')
else writeln(i);
i := 1;
repeat
case i of
1..9:
for i := 1 to i do write(i, ',');
10: begin
writeln;
writeln;
end;
else
myProcedure;
end;
until i >= 10;
result := true;
end;
//# main program
var
c, r: Integer;
s: String;
a: Array of Integer;
BEGIN
//! clear first
ClrScr;
SetLength(a, 10);
FOR c := 0 TO High(a) DO
a[c] := c;
FOR c := 0 TO High(a) DO
IF i < High(a) THEN write(a[c], ',')
ELSE writeln;
c := ScreenWidth; //* screen size
r := ScreenHeight;
s := 'Screen size: ';
writeln(s, c, '×', r);
write('Enter your name: '); //? input
readln(s);
writeln('Hello, ', s, '!'); //+ forgotten
//-readln; // unnecessary
// TODO: to-do next
END.