home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Game Killer
/
Game_Killer.bin
/
084.INITDEFS.INC
< prev
next >
Wrap
Text File
|
1992-07-23
|
2KB
|
67 lines
procedure stripwhite( var s : string );
var
i : byte;
temp : string;
begin
temp := '';
for i := 1 to length( s ) do
if s[i] > ' ' then
temp := temp + s[i];
s := temp;
end;
procedure GetInits( var wordy, monochrome : boolean );
{
look for file TWVIEW.CFG in default directory. If you find it, look for
lines of the form "VERBOSE = " and "MONOCHROME =" -- and set the variables
to true or false. Default values are verbose set to true, and monochrome
set to false.
}
var
f : text;
line : string;
i : byte;
begin
wordy := true;
monochrome := false;
assign( f, 'twview.cfg');
{$I-}
reset( f );
{$I+}
if ioresult <> 0 then
exit;
while not eof( f ) do
begin
readln( f, line );
stripwhite( line );
line := upstring( line );
if pos( 'VERBOSE', line ) > 0 then
begin
i := pos( '=', line );
if i = 0 then
begin
writeln( 'couldn''t find = on verbose configuration line "', line, '"');
readln;
end
else
wordy := line[ i + 1 ] in ['t', 'T', '1' ];
end
else if pos( 'MONOCHROME', line ) > 0 then
begin
i := pos( '=', line );
if i = 0 then
begin
writeln( 'couldn''t find = on monochrome configuration line "', line, '"');
readln;
end
else
monochrome := not (line[ i + 1 ] in ['f', 'F', '0' ]);
end
else
begin
writeln('Configuration line "', line, '" not understood.');
readln;
end;
end; {while}
close( f );
end;