-
Notifications
You must be signed in to change notification settings - Fork 1
/
pprocs.pas
79 lines (67 loc) · 1.16 KB
/
pprocs.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
{
poly - procedures
}
{$I PDEFS}
unit PProcs;
interface
function KeyPressed:boolean;
procedure SaveSetup;
procedure LoadISP;
procedure SaveISP;
implementation
uses
XDev,Objects,PTypes,Drivers,XKey;
procedure LoadISP;
var
T:TDosStream;
P:PISpanyolet;
w:word;
begin
if ispList = NIL then New(ispList,Init(10,10));
ispList^.FreeAll;
T.Init(wkdir+ispFile,stOpenRead);
if T.Status = stOK then begin
T.Read(w,SizeOf(w));
while w > 0 do begin
New(P);
T.Read(P^,SizeOf(TISpanyolet));
ispList^.Insert(P);
dec(w);
end;
end;
T.Done;
end;
procedure SaveISP;
var
T:TDosStream;
i:integer;
w:word;
begin
{$IFNDEF DEMO}
T.Init(wkdir+ispFile,stCreate);
w := ispList^.Count;
T.Write(w,SizeOf(w));
for i:=0 to ispList^.Count-1 do T.Write(PIspanyolet(ispList^.At(i))^,SizeOf(TIspanyolet));
T.Done;
{$ENDIF}
end;
procedure SaveSetup;
var
T:TDosStream;
begin
{$IFNDEF DEMO}
EventWait;
T.Init(wkdir+setupFile,stCreate);
T.Write(setup,SizeOf(setup));
T.Done;
SaveISP;
{$ENDIF}
end;
function KeyPressed;
var
Event:TEvent;
begin
GetExtendedKeyEvent(Event);
KeyPressed := Event.What <> evNothing;
end;
end.