home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Game Killer
/
Game_Killer.bin
/
290.CORPREC.INC
< prev
next >
Wrap
Text File
|
1991-07-08
|
3KB
|
108 lines
{ Corp record operations }
procedure ReadFromString( s : string; var index : byte; var result : integer );
{ convert starting at position index an integer, storing in result. Advance
index past integer. }
begin
end; {readFromString}
procedure GetName( s : string; var index : byte; var n : string40 );
{ read the name. It will consist of at least 30 characters, starting at
index, and may consist of more -- it will continue up until we hit "Class".
Advance index past name. }
begin
end; {get name}
procedure GetCitadel( s : string; index : byte; var f : text;
var citadel : citadelType );
{ read starting at index, looking for the citadel level. Its possible it
isn't in the string, in which case we get it from the first line of the
file. In any case, return that in citadel. }
begin
end; {GetCitadel}
procedure GetPop( var f : text; var old, current : NonNegInt;
var change : integer );
{ set old to current, and read current from t. Set change to difference. }
begin
end; {get pop}
procedure GetGoods( var f : text; var stock : stores );
{ read three values, and store them in stock }
begin
end; {GetGoods}
procedure SearchCorpQueue( var c : corp; var p : planet; name : string40 );
{ Search the records to find planet with given name. If not found,
create new planet at end of queue. }
begin
p.note := '';
end; {SearchCorpQueue}
procedure ReadReport( var f : text; var line : string;
var Report : corp );
{ This will read the report starting with "line" and pulling additional
information from the file. It will load it into report. }
var
CurrPlanet : planet;
LinePtr : byte;
s : integer;
n : string40;
begin
LinePtr := 1;
ReadFromString( line, lineptr, s );
GetName( line, lineptr, n );
SearchCorpQueue( Report, CurrPlanet, n );
CurrPlanet.location := s;
GetCitadel( line, lineptr, f, CurrPlanet.citadel );
skip( f, 9 );
GetPop( f, CurrPlanet.LastPop, CurrPlanet.CurrPop, CurrPlanet.ChangePop );
GetGoods( f, CurrPlanet.GoodsProd );
GetGoods( f, CurrPlanet.GoodsOH );
CurrPlanet.fighters := ReadNumber( f );
end; {Read Report}
procedure FindStart( var f : text );
{Find the start of the corporate reports }
const
SizeHeader = 4;
var
line : string;
Found: boolean;
i : integer;
begin
while not (found or eof( f ) ) do
begin
readln( f, line );
found := pos( 'Corporate Planet Scan', line ) > 0;
end; {while}
if found then
for i := 1 to SizeHeader do
readln( f );
end;
procedure AddCorpReport( var Exxon : corp; var PleaseUpdate : boolean );
var
f : text;
filename : string;
line : string;
CurrReport : planet;
begin
reset( f, GetNewFilename( 'Name of downloaded corporate log file?',
'corp.log'));
FindStart( f );
line := '';
while (pos( 'Total Credits', line ) = 0) and (not eof( f )) do
begin
readln( f, line );
ReadReport( f, line, Exxon );
end; {while}
end;
procedure AddNote( var ATT : corp; var PleaseUpdate : boolean );
begin
end;
procedure DisplayInfo( var Beatrice : corp );
begin
end;