forked from quadroid/jcf-pascal-format
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.pas
78 lines (63 loc) · 1.18 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
unit test;
(* JCF CLI test file *)
interface
uses CRT;
type
IFace = interface
['{5E3C2BCA-56C8-46DE-959F-338AF5F69C1A}']
procedure proc;
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;
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.