Debian Codegraph @

Data_Generators/makedata/cargmake.pas

raw
1 program generatecargodata;
2 (********************************************************************
3 This file is part of Ironseed.
4
5 Ironseed is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 Ironseed is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with Ironseed. If not, see <https://www.gnu.org/licenses/>.
17 ********************************************************************)
18
19 {*********************************************
20 Data Generator: Cargo names/sizes
21
22 Copyright:
23 1994 Channel 7, Destiny: Virtual
24 2020 Matija Nalis <[email protected]>
25 **********************************************}
26
27 {$PACKRECORDS 1}
28
29 const
30 maxcargo= 145;
31 type
32 cargotype=
33 record
34 name: string[20];
35 size,index: integer;
36 end;
37 var
38 cargo: cargotype;
39 f: file of cargotype;
40 ft: text;
41 j,i: integer;
42 c: char;
43
44 begin
45 assign(f,'data/cargo.dta');
46 rewrite(f);
47 assign(ft,'Data_Generators/makedata/cargo.txt');
48 reset(ft);
49 readln(ft);
50 for i:=1 to maxcargo do
51 begin
52 read(ft,cargo.index);
53 for j:=1 to 5 do read(ft,c);
54 read(ft,cargo.name);
55 readln(ft,cargo.size);
56 write(f,cargo);
57 writeln(cargo.name,'/',cargo.index,'/',cargo.size);
58 end;
59 close(f);
60 close(ft);
61 end.