home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS 1
/
BBS#1.iso
/
maximus
/
ublutils.arj
/
UBL2NC4
/
UBL2NC4.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1993-08-07
|
3KB
|
121 lines
{è«¡óÑαΓ«α UBL-List ó ΓѽÑΣ«¡¡πε ñ¿αÑ¬Γ«α¿ε NC 4.0}
{ ubl2nc4 }
{ ver. 1.2 }
{ (c) è«»δ½«ó æ.Ç. ¿ε½∞ 1993 }
{ E-mail: cop@horus.msk.su }
{
éδ ¼«ªÑΓÑ «Γí½áú«ñáα¿Γ∞ »α«úαá¼¼¿ßΓá ºá íÑßß«¡¡« »α«óÑñÑ¡¡πε ¡«τ∞,
¡á»αáó¿ó ß¿¼ó«½¿τÑ߬«Ñ ñѡѪ¡«Ñ 󫺡áúαáªñÑ¡¿Ñ »« áñαÑßπ:
î«ß¬óá, π½.è¿α«ó«úαáñ߬á∩, 24, ¬«α» 4, ¬ó 7, è«»δ½«óπ æÑαúÑε Ç¡áΓ«½∞Ñó¿τπ
»αÑñ∞∩ó¿ΓÑ½ε »áß»«αΓá ßÑα¿¿ XXVIII-î₧ N 550533
}
type
DirEntry = record { ºá»¿ß∞ ΓѽÑΣ«¡¡«⌐ ñ¿αÑ¬Γ«α¿¿ - óßÑú« 128 íá⌐Γ}
Name: array [1..24] of byte;
Phone: array [1..24] of byte;
Emul: array [1..8] of byte;
Protocol: array [1..8] of byte;
Cmd : array [1..14] of byte;
Script: array [1..14] of byte;
Rest : array [1..36] of byte; {«ßΓáΓ«¬ ºá»¿ß¿ ¡Ñ 󻫽¡Ñ ∩ßÑ¡}
end;
const
cEmul :array [1..8] of byte = ($60,$09,$00,$00,$08,$00,$00,$00);
cProtocol:array [1..8] of byte = ($01,$00,$00,$00,$26,$04,$f9,$01);
BS:char=chr(8);
var
DirFile : file of DirEntry;
Rec:DirEntry;
f: text;
istr:string[128];
i,j:integer;
tName:string[24];
tPhone:string[24];
city:integer;
Moscow:boolean;
procedure help;
begin
writeln('è«¡óÑαΓÑα UBList ó ΓѽÑΣ«¡¡πε ñ¿αÑ¬Γ«α¿ε NC 4.0 term90.dir');
writeln(' (c) è«»δ½«ó æ.Ç. ¿ε½∞ 1993 ver 1.2');
writeln;
writeln('êß»«½∞º«óá¡¿Ñ: ubl2nc4 [ubl_file] [-m]');
writeln('Ä»µ¿∩ -m ¿ß»«½∞ºπÑΓß∩ ñ½∩ î«ß¬óδ');
end;
procedure init;
var j:integer;
begin
city:=0;
Moscow:=false;
with Rec do begin
for j:=1 to 24 do Name[j]:=0;
for j:=1 to 24 do Phone[j]:=0;
for j:=1 to 8 do Emul[j]:=cEmul[j];
for j:=1 to 8 do Protocol[j]:=cProtocol[j];
for j:=1 to 14 do Cmd[j]:=0;
for j:=1 to 14 do Script[j]:=0;
for j:=1 to 36 do Rest[j]:=0;
end
end;
begin
init;
if paramcount <1 then begin
help;
halt;
end;
if paramcount =2 then begin
if (paramstr(2) = '-m') or (paramstr(2) = '-M') then Moscow:=true
else begin
help;
halt;
end;
end;
{$I-}
Assign(f, paramstr(1));
Reset(f);
{$I+}
if (IOResult = 0) then begin
Assign(dirFile,'term90.dir');
rewrite(Dirfile);
i:=1;
while not eof(f) do begin
readln(f,istr);
if istr[3]=chr(254) then inc(city);
if (istr[1]= chr($b3)) and (istr[3] <> chr(254)) and (istr[3]<>' ') then begin
write(bs,bs,bs); write(i); inc(i);
tName :=chr(city) + Copy(istr,3,24);
tName[24]:=chr(0);
if Moscow and (city=1) then begin {î«ß¬óá »Ñαóá∩ ó ß»¿ß¬Ñ}
tPhone:=Copy(istr,35,8);
tPhone[9]:=chr(0);
end
else begin
tPhone:=Copy(istr,31,12);
tPhone[13]:=chr(0)
end;
with Rec do begin
for j:=1 to 24 do Name[j]:=byte(tName[j]);
for j:=1 to 24 do Phone[j]:=byte(tPhone[j]);
end;
write(DirFile,Rec);
end; {if}
end; {while}
end; {if}
close(DirFile);
close(f);
writeln;
writeln('OK ');
end.