Debian Codegraph @

Data_Generators/makedata/elemmake.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: Element names
21
22 Copyright:
23 1994 Channel 7, Destiny: Virtual
24 2020 Matija Nalis <[email protected]>
25 **********************************************}
26
27 {$PACKRECORDS 1}
28
29 type
30 elemtype= string[24];
31 var
32 f: file of elemtype;
33 ft: text;
34 index,j,i: integer;
35 c: char;
36 elem: elemtype;
37
38 begin
39 assign(f,'data/elements.dta');
40 rewrite(f);
41 assign(ft,'Data_Generators/makedata/element.txt');
42 reset(ft);
43 read(ft,index);
44 repeat
45 for j:=1 to 4 do read(ft,c);
46 elem:=' ';
47 readln(ft,elem);
48 elem[0]:=chr(24);
49 i:=25;
50 repeat
51 dec(i);
52 until elem[i]<>' ';
53 if i<24 then for j:=i+1 to 24 do elem[j]:=' ';
54 for j:=1 to 24 do elem[j]:=upcase(elem[j]);
55 write(f,elem);
56 writeln(elem);
57 read(ft,index);
58 until index=0;
59 close(f);
60 close(ft);
61 end.