-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmoncopy.pas
50 lines (43 loc) · 1 KB
/
moncopy.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
[INHERIT ('monconst','montype','monglobl')]
MODULE MonCopy(OUTPUT);
%include 'headers.txt'
PROCEDURE PrintOptions;
BEGIN
Writeln('c - class');
END;
PROCEDURE CopyClass(VAR AllStats : AllMyStats);
VAR
From, Tos : String;
OldClass, NewClass : INTEGER;
Found : BYTE_BOOL;
Class : ClassRec;
BEGIN
GrabLine('Copy from class: ', From, AllStats);
IF LookupName(nt_realshort, rsnr_class, OldClass, From, FALSE, FALSE) THEN
BEGIN
GrabLine('Copy to class: ', ToS, AllStats);
Found := LookupName(nt_realshort, rsnr_class, NewClass, ToS, FALSE);
IF NOT Found THEN
Writeln('You must create the class first.')
ELSE
BEGIN
IF GetClass(OldClass, Class) THEN
SaveClass(NewClass, Class);
END;
END;
END;
[GLOBAL]
PROCEDURE DoCopy(S : String; VAR AllStats : AllMyStats);
VAR
Ltype, Lsize : INTEGER;
BEGIN
Ltype := 0;
IF (Length(S) > 0) THEN
BEGIN
CASE S[1] OF
'c' : CopyClass(AllStats);
OTHERWISE PrintOptions;
END;
END ELSE PrintOptions;
END;
END.