-
Notifications
You must be signed in to change notification settings - Fork 0
/
FILE2.PAS
173 lines (157 loc) · 3.78 KB
/
FILE2.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
{$I DIRECT.INC}
Unit File2;
{/ newscan configuration /}
Interface
Uses GenTypes;
Procedure FixNewScan;
Implementation
Uses ConfigRt, GenSubs, Windows, Subs1, Subs2, File0, File1, Flags,
FileLock;
Procedure FixNewScan;
Const Index : Array[1..10] of Byte = (0,20,40,60,80,100,120,140,160,180);
Var Back,Page,i : Byte;
TotalPages : Byte;
Start,Last : Byte;
Size : Integer;
K : Char;
Procedure PlaceBar(Hi : Boolean);
Begin
If Hi Then ansicolor(urec.color7)
Else ansicolor(urec.color6);
GoXy(9,i + 3);
Tab(Strr( i + Index[Page]),2);
End;
Procedure TopLines;
Begin
GoXy(1,1);
SendCr(^R'Current Page'^A': '^S+Strr(Page)+^R' of '^S+Strr(TotalPages)+
+^R' ['^A'û'^R'] On ['^A'+'^R'] PageDn ['^A'-'^R'] PageUp ['^A'Arrows'^R'] Move ['^A'Q'^R'] Quit');
SendCr(^O'ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ[ '^P'File Area NewScan Config'^O' ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ');
End;
Procedure Draw20;
Var X,Y : Byte;
Begin
AnsiReset;
AnsiCls;
TopLines;
ClearBreak;
NoBreak := True; {21}
Start := Index[Page] + 1;
Last := Start + 19; {40}
If Last > Size Then Last := Size;
Y := 3;
For X := Start To Last Do
Begin
Inc(y);
GoXy(8,Y);
SeekAFile(X);
nRead(Afile,Area);
SendFull(^R'['^A);
Tab(Strr(X),2);
SendFull(^R'] ');
If Allowed_in_Area(X,False,Area) Then
Begin
If (X) in NScan.FileNewScan Then SendFull(' '^S)
Else SendFull('û '^S);
If (Area.Password<>'') and (Not (X in EnterPw))
Then Tabul('[ Password Protected ]',30)
Else Tabul(Area.Name,30);
SendFull(^R' Uploads'^A': '^S);
Tab(YesNo(Area.Uploads),3);
SendFull(^R' Downloads'^A': '^S);
Tab(YesNo(Area.Downloads),3);
End
Else SendFull(^R' No Area Exists Uploads'^A': '^R'Downloads'^A':');
End;
End;
Procedure Tag;
Begin
SeekAFile(i + Index[Page]);
nRead(Afile,Area);
If Allowed_in_Area(i + Index[Page],False,Area) Then
With NScan Do
If (i + Index[Page]) In FileNewScan Then
Begin
FileNewScan := FileNewScan-[i+Index[Page]];
SendFull(^R'] û');
SendFull(B_(3));
End
Else
Begin
FileNewScan := FileNewScan+[i+Index[Page]];
SendFull(^R'] ');
SendFull(B_(3));
End;
End;
Procedure Down;
Begin
If (Page=TotalPages) and (i + Index[Page] = Size) Then Exit;
PlaceBar(False);
Inc(i);
If (i + Index[Page]) > Last Then
Begin
i := 1;
Inc(Page);
Draw20;
PlaceBar(True);
Exit;
End;
PlaceBar(True);
End;
Procedure Up;
Begin
If (Page=1) and (i=1) Then Exit;
PlaceBar(False);
Dec(i);
If i = 0 Then
Begin
i := 20;
Dec(Page);
Draw20;
PlaceBar(True);
Exit;
End;
PlaceBar(True);
End;
Procedure PageUp;
Begin
If (Page=1) Then Exit;
Dec(Page);
i:=1;
Draw20;
PlaceBar(True);
End;
Procedure PageDown;
Begin
If (Page>=TotalPages) Then Exit;
Inc(Page);
i:=1;
Draw20;
PlaceBar(True);
End;
Begin
Size := FileSize(AFile);
TotalPages := Size DiV 20 + 1;
Back := CurArea;
Page := 1;
i := 1;
Draw20;
PlaceBar(true);
Repeat
K := ArrowKey(False);
K := Upcase(K);
Case K Of
#32 : Tag;
^D,^A,'8': Up;
^C,^B,'2': Down;
'+','9' : PageDown;
'-','3' : PageUp;
End;
Until (K='Q') or (HungUpOn);
WriteScanRec(NScan,FileConf);
CurArea := Back;
SetArea(CurArea,True);
AnsiReset;
AnsiCls;
End;
end.