home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Game Killer
/
Game_Killer.bin
/
293.REPORT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-07-08
|
2KB
|
77 lines
program CorpReports;
{
Open Corp Reports file
Open current corp report
Compute elapsed time since last corp report for this galaxy (BBS)
Look for line "Corporate Planet Scan"
skip four more lines
read a line
while doesn't have "Total Credits" in it and not eof
read sector, planet name, citadel type, population, change goods,
goods on hand, credits;
compute change in citadel, population
store in data base
allow inquirys
}
const
maxSector = 1000;
abort = 'abort';
FileNotFound = -42;
type
NonNegInt = 0..maxint;
goods = ( Fuel, Organics, Equipment );
stores = array [ goods ] of NonNegInt;
string80 = string [80];
string40 = string [40];
CitadelType = 0..4;
sector = 1..maxSector;
planetptr = ^planet;
byte = 0..255;
planet = record
location : sector;
name : string80;
LastPop : NonNegInt;
CurrPop : NonNegInt;
ChangePop : integer;
Citadel : CitadelType;
GoodsProd,
GoodsOH : stores;
Fighters : NonNegInt;
Note : string80;
next : planetptr;
end; {planet}
queue = record
front, rear : planetptr;
end;
corp = record
numPlanets : NonNegInt;
territory : queue;
end; {corp}
var
MegaCorp : corp;
changed,
quit : boolean;
{$I general.inc }
{$I CorpIO.inc }
{$I CorpRec.inc }
begin {main}
OpenCorpRecords( MegaCorp );
quit := false;
changed := false;
repeat
case GetCommand of
'R' : AddCorpReport( MegaCorp, changed );
'N' : AddNote( MegaCorp, changed );
'Q' : Quit := true;
'I' : DisplayInfo( MegaCorp );
otherwise
menu;
end; {case}
until quit;
if changed then
SaveCorpRecords( MegaCorp );
end.