-
Notifications
You must be signed in to change notification settings - Fork 0
/
TOP.PAS
497 lines (441 loc) · 16.6 KB
/
TOP.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
{$A+,B-,D+,E-,F+,G+,I+,L+,N-,O-,P+,Q-,R+,S+,T-,V+,X+}
program Top;
{$M 45000,0,300000}
uses Crt,Dos,KBM,Tkwin,{Fenster}Archive,Init,Tkstring,
Tpinst,Tkdisk,Tkstream,Tksaa,Tkvideo,Swap,Tctrl2;
procedure Ende;
var T :text;
begin
textcolor(Lightgray);textbackground(black);
window(1,1,crtxmax,crtymax); winclrscr;
tpibegin;
tpiput(604,1,m_sort);
tpiput(605,1,m_attrib);
tpiput(606,1,m_color);
tpiput(607,1,m_prgend);
tpiput(608,1,m_auto);
tpiput(609,1,m_flashend);
tpiput(610,1,m_ver);
tpiput(611,1,m_interM);
tpiput(612,51,m_packverz);
tpiput(664,51,m_tempverz);
If (RFenster^.dat.ver[1].name<>addbackslash(restlauf+':')) and auto then
tpiput(715,1,RFenster^.dat.ver[1].name[1]);
tpiput(716,1,m_pack);
tpiput(717,1,m_komp);
tpiput(718,41,Name);
tpiput(760,41,Strasse);
tpiput(802,41,Ort);
tpiput(844,6 ,Liznr);
If not Test then
tpiend(((RFenster^.dat.ver[1].name<>addbackslash(restlauf+':')) and auto) or
(m_pack<>pack) or
(m_komp<>komp) or
(m_packverz<>packverz) or
(m_tempverz<>tempverz) or
(m_prgend<>prgend) or
(m_sort<>sort) or
(m_color<>color) or
(m_attrib<>attrib) or
(m_auto<>auto) or
(m_flashend<>flashend) or
(m_ver<>ver) or
(m_interM<>interM));
RFenster^.Done;
LFenster^.Done;
AFenster^.Done;
Drive.DelFile;Drive.Done;
Pdat.Delfile; Pdat.Done;
Packer_File.Done; Hilfe.Done;
setverify(ver);chver(merkdir);cursor_on;
textcolor(Lightgray);textbackground(black);
writeXY(1,1,
{crypt('TOP - Toms Oberfl„che fr Packprogramme - V2.1, Copyright 1992-95, Thomas Kn”fel'));}
crypt('UMS$(&Sgdy+Cok}v}–p|p6q™k:K}~uoRNEQEHKB'#8#4#10'}'#30#3#31#3#16'r]CMG_PPM'#26#10#5#4#12#18'ytnc'#16'-)*):j'#0'"Ù(*<'));
If not Demo then
begin
writeXY(1,3,crypt('Mkyakunm{~+jŒ|5')); {Lizensiert fr:}
WinFrame(19,4,61,8,true);
writeXY(20,5,center(crypt(Name),40));
writeXY(20,6,center(crypt(Strasse),40));
writeXY(20,7,center(crypt(Ort),40));
gotoXY(1,9);
end;
halt(0);
end;
procedure Back_o_Rest;
var paverz : string;
veranz : word;
begin
new(RFenster); new(LFenster); new(AFenster);
If (RFenster=NIL) or (LFenster=NIL) or (AFenster=NIL) then
begin
HErrorMsg; halt(1);
end;
Rahmen;
If Demo then Hilfe.ViewPage(2);
Drive.Init (concat(addbackslash(m_tempverz),Drivename),SizeOf(Dtemp));
Pdat.Init (concat(addbackslash(m_tempverz),Pdatname));
paverz:=concat(addbackslash(readprogdir(paramstr(0))),Packername);
Packer_File.Init (paverz,SizeOf(Dparam));
Findfirst(paverz,$27,Dirinfo);
If (Dirinfo.Name='') then
begin
Packer_File.Create; Packer_File.Close; Doserror:=0;
end;
Drive.Create; Drive.Close;
Pdat.Create; Pdat.Close;
lw.Dr:=restlauf;
DriveKind(lw);
If auto and (lw.ch<>'') then
begin
LFenster^.dat.ver[1].name :=merkdir[1]+':\';
RFenster^.dat.ver[1].name :=restlauf+':\';
FindFirst(concat(addbackslash(merkdir),'*.*'), $35, DirInfo);
repeat
Findnext(DirInfo);
until ((DirInfo.Name<>'.') and (DirInfo.Name<>'..')) or (Doserror>0);
If Doserror=0 then
begin
RFenster^.dat.ver_dat:=true;
FensterM:=Links;
end else
begin
RFenster^.dat.ver_dat:=false;
FensterM:=Rechts; Doserror:=0;
end;
end else
begin
FensterM:=Links;
LFenster^.dat.ver[1].name:=merkdir[1]+':\';
RFenster^.dat.ver[1].name:=merkdir[1]+':\';
RFenster^.dat.ver_dat:=true;
end;
LFenster^.dat.vpos:=1;LFenster^.dat.sanf:=1; LFenster^.dat.ver_dat:=true;
LFenster^.dat.aktverz:='';
RFenster^.dat.vpos:=1;RFenster^.dat.sanf:=1; RFenster^.dat.aktverz:='';
ev1.Ereignis:=0; ArcOpen:=false;
If FensterM=Links then
begin
LFenster^.Init;
RFenster^.Init;
AFenster^.Init;
end else
begin
RFenster^.Init;
LFenster^.Init;
AFenster^.Init;
end;
repeat
case FensterM of
Links : begin
LFenster^.Fenster;
case Ftaste of
TAB : begin
FensterM:=Rechts;
end;
CTRL_R: begin
Drive.Open; Lver.Drive:=' ';
While (Lver.Drive <> LFenster^.dat.ver[1].name[1]) and
not Drive.Eof do
begin
Drive.Read(Lver,-1,1);
If Lver.Drive = LFenster^.dat.ver[1].name[1] then
Drive.Remove(Drive.Pos-1,1);
end;
Drive.Close;
LFenster^.VerzNeu;
If not ArcOpen and
(LFenster^.dat.ver[1].name[1] = RFenster^.dat.ver[1].name[1]) then
begin
RFenster^.UnselectAll;
RFenster^.Fenakt(False,True,True);
end;
LFenster^.UnselectAll;
LFenster^.Fenakt(True,False,True);
end;
F3 : begin
LFenster^.Fenakt(True,False,False);
end;
F5 : begin
If m_flashend then ende;
If ArcOpen then
begin
AFenster^.UnselectAll;
AFenster^.Fenakt(False,True,True);
end else
begin
RFenster^.UnselectAll;
RFenster^.Fenakt(False,False,True);
end;
If Kom.ver then
begin
If Kom.ausw then
begin
Lfenster^.Drivedelete;
Lfenster^.VerzNeu;
end else
Lfenster^.VerzAkt;
end else
Lfenster^.UnselectAll;
LFenster^.Fenakt(True,False,True);
end;
F7: begin
If not Arcopen then
begin
RFenster^.Fenakt(False,True,False);
end;
LFenster^.Fenakt(True ,False,False);
end;
F8: begin
If ArcOpen then
begin
AFenster^.UnselectAll;
AFenster^.Fenakt(False,True,True);
end;
If Verzdel then
begin
If not ArcOpen then
begin
Rfenster^.Fenakt(False,True,False);
end;
Lfenster^.Fenakt(True,True,False);
end else
begin
If not ArcOpen then
begin
Rfenster^.UnselectAll;
Rfenster^.Fenakt(False,False,True);
end;
LFenster^.UnselectAll;
Lfenster^.Fenakt(True,False,True);
end;
end;
F2: begin
AFenster^.Laufwerk(true);
RFenster^.Laufwerk(true);
If ArcOpen then
begin
AFenster^.ClrUnterF;
If ch_dat then
AFenster^.UnselectAll;
AFenster^.Fenakt(False,True,ch_dat);
end else
begin
RFenster^.ClrUnterF;
If ch_dat then
RFenster^.UnselectAll;
RFenster^.Fenakt(False,False,ch_dat);
end;
LFenster^.Laufwerk(true);
LFenster^.ClrUnterF;
If ch_dat then
LFenster^.UnselectAll;
LFenster^.Fenakt(True,False,ch_dat);
end;
F9: begin
RFenster^.Readendg;
If ArcOpen then
begin
AFenster^.UnselectAll;
AFenster^.Fenakt(False,True,True);
end else
begin
RFenster^.UnselectAll;
RFenster^.Fenakt(False,False,True);
end;
LFenster^.UnselectAll;
LFenster^.Fenakt(True,False,True);
end;
end;
end;
Rechts: begin
If ArcOpen then
AFenster^.Fenster
else
RFenster^.Fenster;
case Ftaste of
TAB : FensterM:=Links;
CR : begin
If ArcOpen then
RFenster^.Fakt
else
AFenster^.Fakt;
end;
CTRL_R: begin
Drive.Open; Lver.Drive:=' ';
While (Lver.Drive <> RFenster^.dat.ver[1].name[1]) and not ArcOpen and
not Drive.Eof do
begin
Drive.Read(Lver,-1,1);
If Lver.Drive = RFenster^.dat.ver[1].name[1] then
Drive.Remove(Drive.Pos-1,1);
end;
Drive.Close;
If ArcOpen then
begin
AFenster^.UnselectAll;
AFenster^.Fenakt(True,True,True);
end else
begin
RFenster^.VerzNeu;
If LFenster^.dat.ver[1].name[1] = RFenster^.dat.ver[1].name[1] then
begin
LFenster^.UnselectAll;
LFenster^.Fenakt(False,True,True);
end;
RFenster^.UnselectAll;
RFenster^.Fenakt(True,False,True);
end;
end;
F3 : begin
RFenster^.Fenakt(True,False,False);
end;
F5 : begin
If m_flashend then ende;
If Kom.path then
Lfenster^.VerzAkt else
Lfenster^.UnselectAll;
Lfenster^.Fenakt(False,False,True);
If ArcOpen then
begin
AFenster^.UnselectAll;
AFenster^.Fenakt(True,True,True);
end else
begin
RFenster^.UnselectAll;
RFenster^.Fenakt(True,False,True);
end;
end;
F7: begin
LFenster^.Fenakt(False,True,False);
If not ArcOpen then
RFenster^.Fenakt(True ,False,False);
end;
F8: begin
If Verzdel and not ArcOpen then
begin
Lfenster^.Fenakt(False,True,False);
If not ArcOpen then
begin
Rfenster^.Fenakt(True,True,False);
end;
end else
begin
LFenster^.UnselectAll;
Lfenster^.Fenakt(False,False,True);
If not ArcOpen then
begin
Rfenster^.UnselectAll;
Rfenster^.Fenakt(True,False,True);
end;
end;
If ArcOpen then
begin
AFenster^.UnselectAll;
AFenster^.Fenakt(True,True,True);
end;
end;
F2: begin
LFenster^.Laufwerk(true);
LFenster^.ClrUnterF;
If ch_dat then
LFenster^.UnselectAll;
LFenster^.Fenakt(False,False,ch_dat);
AFenster^.Laufwerk(true);
RFenster^.Laufwerk(true);
If ArcOpen then
begin
AFenster^.ClrUnterF;
If ch_dat then
AFenster^.UnselectAll;
AFenster^.Fenakt(True,True,ch_dat);
end else
begin
RFenster^.ClrUnterF;
If ch_dat then
RFenster^.UnselectAll;
RFenster^.Fenakt(True,False,ch_dat);
end;
end;
F9: begin
RFenster^.Readendg;
LFenster^.UnselectAll;
LFenster^.Fenakt(False,False,True);
If ArcOpen then
begin
AFenster^.UnselectAll;
AFenster^.Fenakt(True,True,True);
end else
begin
RFenster^.UnselectAll;
RFenster^.Fenakt(True,False,True);
end;
end;
end;
end;
end;
until Ftaste=ALT_X;
end;
begin
getverify(m_ver);
m_pack := pack;
m_komp := komp;
m_packverz:= packverz;
m_tempverz:= tempverz;
m_prgend := prgend;
m_sort := sort;
m_color := color;
m_attrib := attrib;
m_auto := auto;
m_flashend:= flashend;
m_ver := ver;
m_interM := interM;
If not getver(0,merkdir) then halt(1);
setverify(ver);
getver(DrvLet_Num(tempverz[1]),Verz);
If chver(tempverz) then
begin
m_tempverz:=tempverz;
end else
begin
writeln('Fehlerhaftes Tempor„res-Verzeichnis !');delay(400);
m_tempverz:=justpathname(paramstr(0));
end;
SwapPath := m_tempverz;
RedoutPath:= m_tempverz;
chver(Verz);
top_verz:=addbackslash(justpathname(paramstr(0)));
getver(DrvLet_Num(packverz[1]),Verz);
If chver(packverz) then
begin
m_packverz:=packverz;
end else
begin
write('Fehlerhaftes Packer-Verzeichnis !');delay(400);
m_packverz:=justpathname(paramstr(0));
end;
chver(Verz);
If upstring(paramstr(1))=crypt('UGPP517:>:') then { TEST }
test:=true else test:=false;
If upstring(paramstr(1))=crypt('MKYAKU') then { LIZENS }
begin
writeln(crypt(Name));
writeln(crypt(Strasse));
writeln(crypt(Ort));
writeln(crypt(Liznr)); halt;
end;
If (Name='EGNK') and not test then { DEMO }
begin
Demo:=true;
end;
cursor_off;
case m_color of
1 : Farbe1;
2 : Farbe2;
3 : Monochrome;
end;
Hilfe.init(addbackslash(readprogdir(paramstr(0)))+'top.hlp',$32504f54);
Back_o_Rest;
Ende;
end.