forked from MarkHofmann11/WWIVEdit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
WEDOS.PAS
81 lines (70 loc) · 1.24 KB
/
WEDOS.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
UNIT WEDos;
{$DEFINE CAN_OVERLAY}
{$I WEGLOBAL.PAS}
{ -- Dos Module for WWIVEdit 2.4
-- Provides an interface between the ExecSwap unit and the rest of
-- the program.
-- }
INTERFACE
PROCEDURE JumpDos;
FUNCTION InitSwap:boolean;
PROCEDURE Execute(s:string);
PROCEDURE EndSwap;
IMPLEMENTATION
USES ExecSwap,DOS, WEVars, WEOutput,WEMemory;
VAR
x,y:integer;
FUNCTION InitSwap:boolean;
VAR
ok:boolean;
BEGIN
ok:=InitExecSwap(HeapEnd,'WWIVEDIT.SWP');
IF OK THEN
BEGIN
x:=WhereX; y:=WhereY;
SaveDisplay;
ClrScr;
END;
InitSwap:=ok;
END;
PROCEDURE Execute(s:string);
VAR
p:string;
BEGIN
GetDir(0,p);
IF s<>'' THEN
BEGIN
writeln('Swapping....');
IF ExecWithSwap(GetEnv('COMSPEC'),'/C '+s)=0 THEN
END
ELSE BEGIN
writeln('DOS Shell... Type EXIT to return to WWIVEdit...');
IF ExecWithSwap(GetEnv('COMSPEC'),'')=0 THEN
END;
chdir(p);
END;
PROCEDURE EndSwap;
VAR f:file;
BEGIN
ShutDownExecSwap;
Move(Display^, SaveScreen^, ScreenSize);
RestoreDisplay;
Gotoxy(x,y);
{$I-}
assign(f,'WWIVEDIT.SWP');
SetFAttr(f,0);
IF IOResult=0 THEN
erase(f);
IF IOResult=0 THEN ;
{$I+}
MapPages;
END;
PROCEDURE JumpDos;
BEGIN
IF InitSwap THEN
BEGIN
Execute('');
EndSwap;
END;
END;
END.