Skip to content

Latest commit

 

History

History
1719 lines (1532 loc) · 52.9 KB

conv18a.pas

File metadata and controls

1719 lines (1532 loc) · 52.9 KB
 
Nov 25, 2000
Nov 25, 2000
1
{$A+,B+,E+,F+,I+,L+,N-,O+,R-,S+,V-}
Nov 18, 2000
Nov 18, 2000
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
{$M 50000,0,1024}
uses crt,dos,
myio;
const
needconv = 'S23568CD';
standard_conversion = TRUE;
{$I rcc17a.pas}
{$I rec18a.pas}
var
a,b,lastss,mp,gp,sp:astr;
h,i,j,k,savx,savy:integer;
c:char;
aw:boolean; { author working }
back:boolean; { converting BACK TO PREVIOUS VERSION ! .. }
found:boolean;
dirinfo:searchrec;
ptsforisrequest,ptsfornotval:integer;
wind:windowrec;
didit:boolean;
needs:longint;
artable:astr;
{ systatf17a4:file of systatrec17a4;}
{ systat17a4:systatrec17a4;}
systatf1:file of systatrec1;
systat1:systatrec1;
systatf0:file of systatrec;
systat0:systatrec;
systatf:file of systatrec;
systat:systatrec;
modemrf:file of modemrec;
modemr:modemrec;
fstringf:file of fstringrec;
fstring:fstringrec;
sf1:file of smalrec1;
sr1:smalrec1;
sf:file of smalrec;
sr:smalrec;
uf1:file of userrec1;
user1:userrec1; {**}
uf0:file of userrec;
user0:userrec;
uf:file of userrec;
user:userrec; {**}
bf1:file of boardrec1;
brd1:boardrec1;
{ bf17a5:file of boardrec17a5;}
{ brd17a5:boardrec17a5;}
bf:file of boardrec;
brd:boardrec;
mailfile1:file of mailrec1;
mail1:mailrec1; {**}
mailfile:file of mailrec;
mail:mailrec; {**}
ulf1:file of ulrec1;
ubrd1:ulrec1;
{ ulf17a2:file of ulrec17a2;}
{ ubrd17a2:ulrec17a2;}
ulf0:file of ulrec;
ubrd0:ulrec;
ulf:file of ulrec;
ubrd:ulrec;
ulff1:file of ulfrec1;
uld1:ulfrec1;
ulff:file of ulfrec;
uld:ulfrec;
{ slf1:file of slr1;
seclev1:array[0..255] of slr1;
slf:file of seclevrec;
seclev:seclevrec;}
gfilef1:file of gft1; {**}
gfile1:gft1; {**}
gfilef:file of tfilerec;{**}
gfile:tfilerec; {**}
smf1:file of smr1;
sm1:smr1;
smf:file of smr;
sm:smr;
ztf1:file of zlogt1; {**}
zt1:zlogt1; {**}
ztf:file of zlogrec; {**}
zt:zlogrec; {**}
vdf1:file of vdatar1; {**}
vd1:vdatar1; {**}
vdf:file of vdatar; {**}
vd:vdatar; {**}
macrf:file of macrorec;
macr:macrorec;
xp1:file of protrec1;
xpr1:protrec1;
xp0:file of protrec;
xpr0:protrec;
xp:file of protrec;
xpr:protrec;
mbasef1:file of messagerec1;
mbase1:messagerec1;
mbasef:file of messagerec;
mbase:messagerec;
ff:file;
{**} (* NOT defined globally in COMMON.PAS .... *)
function value(I:astr):integer;
var n,n1:integer;
begin
val(i,n,n1);
if n1<>0 then begin
i:=copy(i,1,n1-1);
val(i,n,n1)
end;
value:=n;
if i='' then value:=0;
end;
function cstrl(li:longint):astr;
var c:astr;
begin
str(li,c);
cstrl:=c;
end;
function cstr(i:integer):astr;
var c:astr;
begin
str(i,c);
cstr:=c;
end;
function tch(i:astr):astr;
begin
if length(i)>2 then i:=copy(i,length(i)-1,2) else
if length(i)=1 then i:='0'+i;
tch:=i;
end;
Mar 2, 2001
Mar 2, 2001
160
161
162
{rcg11272000 dunno if this is even used, but it won't fly under Linux.}
{ below is a working implementation.}
{
Nov 18, 2000
Nov 18, 2000
163
164
165
166
167
168
169
170
function time:astr;
var reg:registers;
h,m,s:string[4];
begin
reg.ax:=$2c00; intr($21,Dos.Registers(reg));
str(reg.cx shr 8,h); str(reg.cx mod 256,m); str(reg.dx shr 8,s);
time:=tch(h)+':'+tch(m)+':'+tch(s);
end;
Mar 2, 2001
Mar 2, 2001
171
}
Nov 18, 2000
Nov 18, 2000
172
Mar 2, 2001
Mar 2, 2001
173
174
175
176
177
178
179
180
181
182
183
184
function time:string;
var h,m,s:string[3];
hh,mm,ss,ss100:word;
begin
gettime(hh,mm,ss,ss100);
str(hh,h); str(mm,m); str(ss,s);
time:=tch(h)+':'+tch(m)+':'+tch(s);
end;
{rcg11272000 dunno if this is even used, but it won't fly under Linux.}
{ below is a working implementation, Y2K fixes included.}
{
Nov 18, 2000
Nov 18, 2000
185
186
187
188
189
190
191
192
function date:astr;
var reg:registers;
m,d,y:string[4];
begin
reg.ax:=$2a00; msdos(Dos.Registers(reg)); str(reg.cx,y); str(reg.dx mod 256,d);
str(reg.dx shr 8,m);
date:=tch(m)+'/'+tch(d)+'/'+tch(y);
end;
Mar 2, 2001
Mar 2, 2001
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
}
function date:string;
var
{rcg11272000 unused variable.}
{r:registers;}
{rcg11272000 Y2K-proofing.}
{y,m,d:string[3];}
m,d:string[3];
y:string[5];
yy,mm,dd,dow:word;
begin
getdate(yy,mm,dd,dow);
{rcg11272000 Y2K-proofing.}
{str(yy-1900,y); str(mm,m); str(dd,d);}
str(yy,y); str(mm,m); str(dd,d);
date:=tch(m)+'/'+tch(d)+'/'+y;
end;
Nov 18, 2000
Nov 18, 2000
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
function leapyear(yr:integer):boolean;
begin
leapyear:=(yr mod 4=0) and ((yr mod 100<>0) or (yr mod 400=0));
end;
function days(mo,yr:integer):integer;
var d:integer;
begin
d:=value(copy('312831303130313130313031',1+(mo-1)*2,2));
if (mo=2) and leapyear(yr) then d:=d+1;
days:=d;
end;
function daycount(mo,yr:integer):integer;
var m,t:integer;
begin
t:=0;
for m:=1 to (mo-1) do t:=t+days(m,yr);
daycount:=t;
end;
function daynum(dt:astr):integer;
var d,m,y,t,c:integer;
begin
t:=0;
m:=value(copy(dt,1,2));
d:=value(copy(dt,4,2));
Nov 19, 2000
Nov 19, 2000
242
243
{rcg11182000 hahahaha...a Y2K bug. :) }
Mar 2, 2001
Mar 2, 2001
244
245
246
247
248
249
250
251
{rcg11272000 Let's make sure the values coming in here are four }
{digits in the first place, which should save us some hacks elsewhere...}
{y:=value(copy(dt,7,2))+1900;}
{rcg11272000 my adds...}
if (length(dt) < 10) then rcgpanic('WHOA! TWO DIGIT YEAR IN DATE!');
y:=value(copy(dt,7,4));
{rcg11272000 end my adds...}
Nov 19, 2000
Nov 19, 2000
252
Nov 18, 2000
Nov 18, 2000
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
for c:=1985 to y-1 do
if leapyear(c) then t:=t+366 else t:=t+365;
t:=t+daycount(m,y)+(d-1);
daynum:=t;
if y<1985 then daynum:=0;
end;
function freek(d:integer):longint; (* See disk space *)
{var r:registers;}
begin
freek:=diskfree(d) div 1024;
{ r.ax:=$3600;
r.dx:=d;
msdos(dos.registers(r));
freek:=trunc(1.0*r.bx*r.ax*r.cx/1024.0);}
end;
procedure tc(i:integer);
begin
textcolor(i);
end;
procedure star(s:astr);
begin
tc(9); write('þ ');
tc(11); writeln(s);
end;
function exdrv(s:astr):byte;
begin
Nov 25, 2000
Nov 25, 2000
284
285
{rcg11242000 point at root drive always. Ugh.}
{
Nov 18, 2000
Nov 18, 2000
286
287
s:=fexpand(s);
exdrv:=ord(s[1])-64;
Nov 25, 2000
Nov 25, 2000
288
289
}
exdrv:=3;
Nov 18, 2000
Nov 18, 2000
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
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
end;
procedure movefile(srcname,destpath:string);
var buffer:array[1..16384] of byte;
dfs,nrec:integer;
src,dest:file;
dd,dn,de:string;
procedure dodate;
var r:registers;
od,ot,ha:integer;
begin
srcname:=srcname+#0;
destpath:=destpath+#0;
with r do begin
ax:=$3d00; ds:=seg(srcname[1]); dx:=ofs(srcname[1]); msdos(dos.registers(r));
ha:=ax; bx:=ha; ax:=$5700; msdos(dos.registers(r));
od:=dx; ot:=cx; bx:=ha; ax:=$3e00; msdos(dos.registers(r));
ax:=$3d02; ds:=seg(destpath[1]); dx:=ofs(destpath[1]); msdos(dos.registers(r));
ha:=ax; bx:=ha; ax:=$5701; cx:=ot; dx:=od; msdos(dos.registers(r));
ax:=$3e00; bx:=ha; msdos(dos.registers(r));
end;
end;
begin
fsplit(srcname,dd,dn,de);
destpath:=destpath+dn+de;
assign(src,srcname);
{$I-} reset(src,1); {$I+}
if (ioresult<>0) then begin
writeln;
star('"'+srcname+'": File not found.'^G^G);
{ halt(1);}
end else begin
dfs:=freek(exdrv(destpath));
{rcg11172000 don't have LONGfilesize()...}
{if (trunc(longfilesize(src)/1024.0)+1>=dfs) then begin}
if (trunc(filesize(src)/1024.0)+1>=dfs) then begin
writeln;
star('"'+srcname+'": Disk full.');
halt(1);
end else begin
assign(dest,destpath); rewrite(dest,1);
repeat
blockread(src,buffer,16384,nrec);
blockwrite(dest,buffer,nrec);
until (nrec<16384);
close(dest);
close(src);
dodate;
erase(src);
end;
end;
end;
procedure smovefile(srcname,destpath:string);
begin
star('Moving "'+srcname+'" to "'+destpath+'"');
movefile(srcname,destpath);
end;
procedure ffile(fn:astr);
begin
findfirst(fn,anyfile,dirinfo);
found:=(doserror=0);
end;
procedure nfile;
var r:registers;
begin
findnext(dirinfo);
found:=(doserror=0);
end;
function allcaps(s:astr):astr; (* returns a COMPLETELY capitalized string *)
var i:integer;
begin
for i:=1 to length(s) do
s[i]:=upcase(s[i]);
allcaps:=s;
end;
procedure cursoron;
var reg:registers;
begin
with reg do begin
ch:=07; cl:=08; ah:=1;
intr($10,reg);
end;
end;
procedure cursoroff;
var reg:registers;
begin
with reg do begin
ch:=09; cl:=00; ah:=1;
intr($10,reg);
end;
end;
procedure prt(s:string);
begin
textcolor(9); write(s);
end;
procedure ttl(s:string);
begin
writeln;
textcolor(9); write('ÄÄ[');
textbackground(1); textcolor(15);
write(' '+s+' ');
textbackground(0); textcolor(9);
write(']');
repeat write('Ä') until wherex=80;
writeln;
end;
procedure ee(s:astr);
begin
clrscr;
writeln;
tc(4); writeln('ERROR:');
writeln;
tc(15); write(' '+s);
writeln;
writeln;
tc(9); write('Hit any key to exit : ');
repeat until keypressed;
c:=readkey;
removewindow(wind); gotoxy(savx,savy);
halt(1);
end;
procedure ss(s:astr);
begin
lastss:=allcaps(s);
star('Searching for "'+lastss+'"');
end;
procedure cantopen;
begin
ee('Unable to open "'+lastss+'"');
end;
function needc(c:char):boolean;
begin
if pos(c,needconv)<>0 then needc:=TRUE else needc:=FALSE;
end;
procedure fvers;
var i:integer;
begin
needs:=0;
writeln;
ss('status.dat');
assign(systatf1,'status.dat');
{$I-} reset(systatf1); {$I+}
if (ioresult<>0) then cantopen;
{$I-} read(systatf1,systat1); {$I+}
if (ioresult<>0) then begin
close(systatf1);
assign(systatf,'status.dat');
reset(systatf);
{$I-} read(systatf,systat); {$I+}
gp:=systat.gfilepath;
mp:=systat.menupath;
close(systatf);
end else begin
gp:=systat1.gfilepath;
mp:=systat1.menupath;
close(systatf1);
end;
inc(needs,sizeof(systatrec));
if needc('1') then begin
ss('names.lst');
assign(sf1,gp+'names.lst');
{$I-} reset(sf1); {$I+}
if (ioresult<>0) then begin
assign(systatf,'status.dat');
reset(systatf);
{$I-} read(systatf,systat); {$I+}
gp:=systat.gfilepath;
mp:=systat.menupath;
close(systatf);
assign(sf1,gp+'names.lst');
{$I-} reset(sf1); {$I+}
if (ioresult<>0) then cantopen;
end;
{$I-} read(sf1,sr1); {$I+}
inc(needs,sizeof(smalrec)*filesize(sf1));
close(sf1);
end;
if needc('2') then begin
ss('user.lst');
assign(uf1,gp+'user.lst');
{$I-} reset(uf1); {$I+}
if (ioresult<>0) then cantopen;
{$I-} read(uf1,user1); {$I+}
inc(needs,sizeof(userrec)*filesize(uf1));
close(uf1);
end;
if needc('3') then begin
ss('boards.dat');
assign(bf1,gp+'boards.dat');
{$I-} reset(bf1); {$I+}
if (ioresult<>0) then cantopen;
{$I-} read(bf1,brd1); {$I+}
inc(needs,sizeof(boardrec)*filesize(bf1));
close(bf1);
end;
if needc('4') then begin
ss('email.dat');
assign(mailfile1,gp+'email.dat');
{$I-} reset(mailfile1); {$I+}
if (ioresult<>0) then cantopen;
{$I-} read(mailfile1,mail1); {$I+}
inc(needs,sizeof(mailrec)*filesize(mailfile1));
close(mailfile1);
end;
if needc('5') then begin
ss('gfiles.dat');
assign(gfilef1,gp+'gfiles.dat');
{$I-} reset(gfilef1); {$I+}
if (ioresult<>0) then cantopen;
{$I-} read(gfilef1,gfile1); {$I+}
inc(needs,sizeof(tfilerec)*filesize(gfilef1));
close(gfilef1);
end;
if needc('6') then begin
ss('protocol.dat');
assign(xp1,gp+'protocol.dat');
{$I-} reset(xp1); {$I+}
if (ioresult<>0) then cantopen;
inc(needs,sizeof(protrec)*filesize(xp1));
close(xp1);
end;
if needc('7') then begin
ss('shortmsg.dat');
assign(smf1,gp+'shortmsg.dat');
{$I-} reset(smf1); {$I+}
if (ioresult<>0) then cantopen;
{$I-} read(smf1,sm1); {$I+}
inc(needs,sizeof(smalrec)*filesize(smf1));
close(smf1);
end;
if needc('8') then begin
ss('uploads.dat');
assign(ulf1,gp+'uploads.dat');
{$I-} reset(ulf1); {$I+}
if (ioresult<>0) then cantopen;
{$I-} read(ulf1,ubrd1); {$I+}
inc(needs,sizeof(ulrec)*filesize(ulf1));
close(ulf1);
end;
if needc('9') then begin
ss('voting.dat');
assign(vdf1,gp+'voting.dat');
{$I-} reset(vdf1); {$I+}
inc(needs,sizeof(vdatar)*filesize(vdf1));
if (ioresult=0) then close(vdf1);
end;
if needc('A') then begin
ss('zlog.dat');
assign(ztf1,gp+'zlog.dat');
{$I-} reset(ztf1); {$I+}
if (ioresult<>0) then cantopen;
{$I-} read(ztf1,zt1); {$I+}
inc(needs,sizeof(zlogrec)*filesize(ztf1));
close(ztf1);
end;
if needc('B') then begin
ss('*.dir');
ffile(gp+'*.dir');
while (found) do begin
assign(ulff1,fexpand(gp+dirinfo.name));
{$I-} reset(ulff1); {$I+}
inc(needs,sizeof(ulfrec)*filesize(ulff1));
close(ulff1);
nfile;
end;
end;
end;
function barconv(c:char):char;
var s:astr;
begin
if (pos(c,artable)<>0) then s:=copy('ABCDEFG',pos(c,artable),1) else s:='@';
barconv:=s[1];
end;
function arconv(c:char):char;
begin
if (c in ['A'..'G']) then
if (length(artable)>=ord(c)-64) and (artable[ord(c)-64] in ['@'..'Z']) then
arconv:=artable[ord(c)-64]
else arconv:='@'
else arconv:='@';
end;
{rcg11172000 had to change this to get it compiling under Free Pascal...}
{function substall(src,old,new:astr):astr;}
function substall(src,old,_new:astr):astr;
var p:integer;
begin
p:=1;
while (p>0) do begin
p:=pos(old,src);
if (p>0) then begin
insert(_new,src,p+length(old));
delete(src,p,length(old));
end;
end;
substall:=src;
end;
procedure bconvert(xx:integer);
var i,j,k:integer;
s:astr;
b:boolean;
begin
case xx of
(*
6:begin
ttl('BACKWARD Converting "PROTOCOL.DAT');
chdir(copy(gp,1,length(gp)-1));
ffile('protocol.dat');
if (not found) then star('PROTOCOL.DAT not found.')
else begin
assign(xp,'protocol.old'); rewrite(xp); close(xp); erase(xp);
assign(xp,'protocol.tcp'); rewrite(xp); close(xp); erase(xp);
assign(xp,'protocol.dat'); reset(xp);
assign(xp1,'protocol.tcp'); rewrite(xp1);
for i:=0 to filesize(xp)-1 do begin
seek(xp,i); read(xp,xpr);
star(' (record #'+cstr(i)+' of '+cstr(filesize(xp)-1)+')'); gotoxy(1,wherey-1);
with xpr1 do begin
active:=(xbactive in xpr.xbstat);
isbatch:=(xbisbatch in xpr.xbstat);
isresume:=(xbisresume in xpr.xbstat);
xferokcode:=(xbxferokcode in xpr.xbstat);
ckeys:=xpr.ckeys;
descr:=xpr.descr;
minbaud:=xpr.minbaud;
maxbaud:=19200; maxbaud:=maxbaud*2;
sl:=xpr.sl;
dsl:=xpr.dsl;
ar:=xpr.ar;
templog:=xpr.templog;
uloadlog:=xpr.uloadlog;
dloadlog:=xpr.dloadlog;
ulcmd:=xpr.ulcmd;
dlcmd:=xpr.dlcmd;
for j:=1 to 6 do begin
ulcode[j]:=xpr.ulcode[j];
dlcode[j]:=xpr.dlcode[j];
end;
envcmd:=xpr.envcmd;
dlflist:=xpr.dlflist;
maxchrs:=xpr.maxchrs;
logpf:=xpr.logpf;
logps:=xpr.logps;
end;
seek(xp1,i); write(xp1,xpr1);
end;
close(xp);
close(xp1);
rename(xp,'protocol.old');
rename(xp1,'protocol.dat');
writeln;
end;
chdir(sp);
end;
*)
12:begin
ttl('-®<®--BACKWARD--®<®- Converting "*.BRD" message base info files');
chdir(copy(gp,1,length(gp)-1));
ffile('*.brd');
if not found then star('No *.BRD files present.')
else begin
repeat
s:=dirinfo.name;
assign(mbasef,copy(s,1,length(s)-3)+'old'); rewrite(mbasef);
close(mbasef); erase(mbasef);
assign(mbasef,copy(s,1,length(s)-3)+'tcp'); rewrite(mbasef);
close(mbasef); erase(mbasef);
assign(mbasef,s); reset(mbasef);
assign(mbasef1,copy(s,1,length(s)-3)+'tcp'); rewrite(mbasef1);
star('Converting "'+s+'" ('+cstr(filesize(mbasef)-1)+' messages)');
for i:=0 to filesize(mbasef)-1 do begin
seek(mbasef,i); read(mbasef,mbase);
with mbase do begin
mbase1.title:=title;
if (validated in messagestat) then mbase1.messagestat:=validated1;
if (unvalidated in messagestat) then mbase1.messagestat:=unvalidated1;
if (deleted in messagestat) then mbase1.messagestat:=deleted1;
mbase1.message.ltr:=message.ltr;
mbase1.message.number:=message.number;
mbase1.message.ext:=message.ext;
mbase1.owner:=owner;
mbase1.date:=mbase1.date;
mbase1.mage:=255;
end;
write(mbasef1,mbase1);
end;
close(mbasef1);
close(mbasef);
rename(mbasef1,copy(s,1,length(s)-3)+'obr');
nfile;
until (not found);
ffile('*.obr');
while (found) do begin
s:=dirinfo.name;
assign(mbasef1,copy(s,1,length(s)-3)+'brd');
rename(mbasef1,copy(s,1,length(s)-3)+'old');
assign(mbasef,s); rename(mbasef,copy(s,1,length(s)-3)+'brd');
nfile;
end;
end;
chdir(sp);
end;
end;
end;
procedure fconvert(xx:integer);
const dcols:clrs=((15,7,7,15,15,15,112,7,143,7),(15,3,1,11,9,14,31,4,140,10));
var i,j,k:integer;
b:boolean;
s,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15:astr;
c:char;
mf,mf1:text;
sepmsgs,nocopy,bla,b1,b2:boolean;
f:file;
mary:array[0..200] of messagerec;
curdir:astr;
newpath:array[1..3] of astr;
fff:file;
menuline:array[1..13] of string[255];
uu:uflags1;
numread:word;
procedure make_paths;
var s:string;
i,j:integer;
begin
for i:=1 to 3 do begin
Nov 25, 2000
Nov 25, 2000
761
762
763
{rcg11242000 Dosism.}
{while copy(newpath[i],length(newpath[i]),1)='\' do}
while copy(newpath[i],length(newpath[i]),1)='/' do
Nov 18, 2000
Nov 18, 2000
764
765
766
767
768
769
770
771
772
773
774
newpath[i]:=copy(newpath[i],1,length(newpath[i])-1);
case i of 1:s:='AFILES'; 2:s:='TRAP'; 3:s:='TEMP'; end;
star(s+' path ("'+fexpand(newpath[i])+'")');
{$I-} mkdir(fexpand(newpath[i])); {$I+}
if (ioresult<>0) then begin
writeln;
star('Error creating directory "'+fexpand(newpath[i])+'"');
halt(1);
end;
if (i=3) then
for j:=1 to 3 do begin
Nov 25, 2000
Nov 25, 2000
775
776
777
{rcg11242000 DOSism.}
(*{$I-} mkdir(fexpand(newpath[i]+'\'+cstr(j))); {$I+}*)
{$I-} mkdir(fexpand(newpath[i]+'/'+cstr(j))); {$I+}
Nov 18, 2000
Nov 18, 2000
778
779
if (ioresult<>0) then begin
writeln;
Nov 25, 2000
Nov 25, 2000
780
781
782
{rcg11242000 DOSism.}
{star('Error creating directory "'+fexpand(newpath[i]+'\'+cstr(j))+'"');}
star('Error creating directory "'+fexpand(newpath[i]+'/'+cstr(j))+'"');
Nov 18, 2000
Nov 18, 2000
783
784
785
halt(1);
end;
end;
Nov 25, 2000
Nov 25, 2000
786
787
788
{rcg11242000 DOSism.}
{newpath[i]:=newpath[i]+'\';}
newpath[i]:=newpath[i]+'/';
Nov 18, 2000
Nov 18, 2000
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
end;
end;
function sacs(b:byte):string;
begin
if (b>0) then sacs:='s'+cstr(b) else sacs:='';
end;
begin
case xx of
0:begin
ttl('Converting "STATUS.DAT"');
ffile('status.dat');
if (not found) then star('STATUS.DAT not found.')
else begin
assign(systatf1,'status.old'); rewrite(systatf1); close(systatf1); erase(systatf1);
assign(systatf1,'status.tcp'); rewrite(systatf1); close(systatf1); erase(systatf1);
assign(systatf,'status.tcp'); rewrite(systatf);
assign(systatf1,'status.dat');
reset(systatf1); read(systatf1,systat1);
if (standard_conversion) then { default settings for STANDARDs }
with systat1 do begin
arq9600rate:=9600;
allstartmenu:='MAIN';
wfcblanktime:=0;
validateallfiles:=FALSE;
maxintemp:=500;
slogtype:=0;
stripclog:=FALSE;
noforcerate:=FALSE;
rebootforevent:=TRUE;
minresume:=100;
windowon:=TRUE;
curwindow:=1;
end;
with systat1 do begin
systat.gfilepath:=gfilepath;
systat.afilepath:=afilepath;
systat.menupath:=menupath;
systat.trappath:=trappath;
systat.pmsgpath:=pmsgpath;
systat.tfilepath:=tfilepath;
systat.temppath:=temppath;
systat.bbsname:=bbsname;
systat.bbsphone:=bbsphone;
systat.sysopname:=sysopfirst+' '+sysoplast;
{**} systat.maxusers:=500;
systat.lowtime:=lowtime;
systat.hitime:=hitime;
systat.dllowtime:=dllowtime;
systat.dlhitime:=dlhitime;
systat.shuttlelog:=matrix;
systat.lock300:=lock300;
systat.sysoppw:=sysoppw;
systat.newuserpw:=boardpw;
systat.shuttlepw:=bbspw;
systat.b300lowtime:=b300lowtime;
systat.b300hitime:=b300hitime;
systat.b300dllowtime:=b300dllowtime;
systat.b300dlhitime:=b300dlhitime;
systat.closedsystem:=closedsystem;
systat.snowchecking:=snowchecking;
systat.eventwarningtime:=eventwarningtime;
systat.tfiledate:=tfiledate;
systat.hmsg.ltr:=hmsg.ltr;
systat.hmsg.number:=hmsg.number;
systat.hmsg.ext:=hmsg.ext;
for j:=1 to 20 do systat.res[j]:=0;
systat.sop:=sacs(sop);
systat.csop:=sacs(csop);
systat.msop:=sacs(msop);
systat.fsop:=sacs(fsop);
systat.spw:=sacs(spw);
systat.seepw:=sacs(seepw);
systat.normpubpost:=sacs(normpubpost);
systat.normprivpost:=sacs(normprivpost);
systat.anonpubread:=sacs(anonpubread);
systat.anonprivread:=sacs(anonprivread);
systat.anonpubpost:=sacs(anonpubpost);
systat.anonprivpost:=sacs(anonprivpost);
systat.seeunval:=sacs(seeunval);
systat.dlunval:=sacs(dlunval);
systat.nodlratio:=sacs(nodlratio);
systat.nopostratio:=sacs(nopostratio);
systat.nofilepts:=sacs(nofilepts);
systat.ulvalreq:=sacs(ulvalreq);
for j:=1 to 100 do systat.res2[j]:=0;
systat.maxprivpost:=maxprivpost;
systat.maxfback:=maxfback;
systat.maxpubpost:=maxpubpost;
systat.maxchat:=maxchat;
systat.maxwaiting:=maxwaiting;
systat.csmaxwaiting:=csmaxwaiting;
systat.maxlines:=maxlines;
systat.csmaxlines:=csmaxlines;
systat.maxlogontries:=tries;
systat.bsdelay:=bsdelay;
systat.sysopcolor:=sysopcolor;
systat.usercolor:=usercolor;
systat.minspaceforpost:=minspaceforpost;
systat.minspaceforupload:=minspaceforupload;
systat.backsysoplogs:=backsysoplogs;
systat.wfcblanktime:=wfcblanktime;
for j:=1 to 20 do systat.res3[j]:=0;
systat.specialfx:=special;
systat.clearmsg:=clearmsg;
systat.allowalias:=alias;
systat.phonepw:=fone;
systat.localsec:=localsec;
systat.localscreensec:=localscreensec;
systat.globaltrap:=globaltrap;
systat.autochatopen:=autochatopen;
systat.autominlogon:=autominlogon;
systat.bullinlogon:=bullinlogon;
systat.lcallinlogon:=lcallinlogon;
systat.yourinfoinlogon:=yourinfoinlogon;
systat.multitask:=multitask;
systat.offhooklocallogon:=offhooklocallogon;
systat.forcevoting:=forcevoting;
systat.compressbases:=compressbases;
systat.searchdup:=searchdup;
systat.slogtype:=slogtype;
systat.stripclog:=stripclog;
systat.newapp:=app;
systat.guestuser:=guestuser;
systat.timeoutbell:=timeoutbell;
systat.timeout:=timeout;
for j:=1 to 20 do systat.res4[j]:=0;
for j:=1 to maxarcs1 do begin
systat.filearcinfo[j].active:=filearcinfo[j].active;
systat.filearcinfo[j].ext:=filearcinfo[j].ext;
systat.filearcinfo[j].listline:=filearcinfo[j].listline;
systat.filearcinfo[j].arcline:=filearcinfo[j].arcline;
systat.filearcinfo[j].unarcline:=filearcinfo[j].unarcline;
systat.filearcinfo[j].testline:=filearcinfo[j].testline;
systat.filearcinfo[j].cmtline:=filearcinfo[j].cmtline;
systat.filearcinfo[j].succlevel:=filearcinfo[j].succlevel;
end;
systat.filearcinfo[7].ext:='';
systat.filearcinfo[8].ext:='';
for j:=1 to 3 do systat.filearccomment[j]:=filearccomment[j];
systat.uldlratio:=uldlratio;
systat.fileptratio:=fileptratio;
systat.fileptcomp:=fileptcomp;
systat.fileptcompbasesize:=fileptcompbasesize;
systat.ulrefund:=ulrefund;
systat.tosysopdir:=tosysopdir;
systat.validateallfiles:=validateallfiles;
systat.remdevice:=remdevice;
systat.maxintemp:=maxintemp;
systat.minresume:=minresume;
{**} systat.maxdbatch:=30;
{**} systat.maxubatch:=30;
for j:=1 to 30 do systat.res5[j]:=0;
systat.newsl:=newsl;
systat.newdsl:=newdsl;
systat.newar:=[];
for c:='A' to 'Z' do
if (c in newar) then systat.newar:=systat.newar+[c];
systat.newac:=[];
if (rlogon1 in newac) then systat.newac:=systat.newac+[rlogon];
if (rchat1 in newac) then systat.newac:=systat.newac+[rchat];
if (rvalidate1 in newac) then systat.newac:=systat.newac+[rvalidate];
if (rbackspace1 in newac) then systat.newac:=systat.newac+[rbackspace];
if (ramsg1 in newac) then systat.newac:=systat.newac+[ramsg];
if (rpostan1 in newac) then systat.newac:=systat.newac+[rpostan];
if (rpost1 in newac) then systat.newac:=systat.newac+[rpost];
if (remail1 in newac) then systat.newac:=systat.newac+[remail];
if (rvoting1 in newac) then systat.newac:=systat.newac+[rvoting];
if (rmsg1 in newac) then systat.newac:=systat.newac+[rmsg];
if (fnodlratio1 in newac) then systat.newac:=systat.newac+[fnodlratio];
if (fnopostratio1 in newac) then systat.newac:=systat.newac+[fnopostratio];
if (fnofilepts1 in newac) then systat.newac:=systat.newac+[fnofilepts];
if (fnodeletion1 in newac) then systat.newac:=systat.newac+[fnodeletion];
systat.newfp:=newfp;
systat.autosl:=autosl;
systat.autodsl:=autodsl;
systat.autoar:=[];
for c:='A' to 'Z' do
if (c in autoar) then systat.autoar:=systat.autoar+[c];
systat.autoac:=[];
if (rlogon1 in autoac) then systat.autoac:=systat.autoac+[rlogon];
if (rchat1 in autoac) then systat.autoac:=systat.autoac+[rchat];
if (rvalidate1 in autoac) then systat.autoac:=systat.autoac+[rvalidate];
if (rbackspace1 in autoac) then systat.autoac:=systat.autoac+[rbackspace];
if (ramsg1 in autoac) then systat.autoac:=systat.autoac+[ramsg];
if (rpostan1 in autoac) then systat.autoac:=systat.autoac+[rpostan];
if (rpost1 in autoac) then systat.autoac:=systat.autoac+[rpost];
if (remail1 in autoac) then systat.autoac:=systat.autoac+[remail];
if (rvoting1 in autoac) then systat.autoac:=systat.autoac+[rvoting];
if (rmsg1 in autoac) then systat.autoac:=systat.autoac+[rmsg];
if (fnodlratio1 in autoac) then systat.autoac:=systat.autoac+[fnodlratio];
if (fnopostratio1 in autoac) then systat.autoac:=systat.autoac+[fnopostratio];
if (fnofilepts1 in autoac) then systat.autoac:=systat.autoac+[fnofilepts];
if (fnodeletion1 in autoac) then systat.autoac:=systat.autoac+[fnodeletion];
systat.allstartmenu:=allstartmenu;
for j:=1 to 50 do systat.res6[j]:=0;
for j:=0 to 255 do systat.timeallow[j]:=timeallow[j];
for j:=0 to 255 do systat.callallow[j]:=callallow[j];