home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hacker Chronicles 2
/
HACKER2.BIN
/
452.NETINIT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-11-19
|
2KB
|
86 lines
procedure read_config_file;
var init_file : text;
dmy : string[12];
i : integer;
begin
size_of_net := max_old;
assign(init_file,'NET.CFG');
{$I-}
reset(init_file);
if (IOresult = 0) then
begin
readln(init_file,dmy,size_of_net);
readln(init_file,dmy,aux_b);
readln(init_file,dmy,aux_f);
readln(init_file,dmy,brite_b);
readln(init_file,dmy,brite_f);
readln(init_file,dmy,border_b);
readln(init_file,dmy,border_f);
readln(init_file,dmy,status_f);
readln(init_file,dmy,norm_b);
readln(init_file,dmy,norm_f);
readln(init_file,dmy,say_b);
readln(init_file,dmy,say_f);
readln(init_file,dmy,get_b);
readln(init_file,dmy,get_f);
readln(init_file,dmy,first);
if first > 0 then first := 1;
{ make sure max_old is a valid factor of 2 }
max_old := 1;
repeat max_old := max_old SHL 1 until max_old >= size_of_net;
close(init_file);
end;
end;
procedure net_list_init;
var i, max : integer;
begin
if (35.0 * max_old) > (MaxAvail) then
begin
i := round(MaxAvail / 35.0);
max := 1;
repeat max := max SHL 1 until max > i;
max := max SHR 1;
clrscr;
write('Insufficient memory to support data arrays for ');
writeln(size_of_net,' records.');
writeln('This computer can support ',max,' records.');
writeln('Correct NET.CFG file line # 1 to fix this problem.');
writeln;
halt;
end;
for i := 1 to max_old do
begin
new(net_list[i]);
net_list[i]^.xref := 0;
net_list[i]^.suffix := '';
end;
for i := 1 to max_new do
begin
new(new_list[i]);
new_list[i]^.xref := 0;
new_list[i]^.suffix := '';
end;
end;
procedure net_init;
var i : word;
begin
read_config_file;
default_file := default;
nbr_calls := 0;
curr_pntr := 0;
top_pntr := 0;
new_pntr := 0;
mark1 := 0;
mark2 := 0;
update_flag := FALSE;
leaving := FALSE;
net_list_init;
GetTime(i,i,this_second,i);
key := #0;
border_attribute := border_b SHL 4 + border_f;
normcolor;
end;