-
Notifications
You must be signed in to change notification settings - Fork 4
/
make_speeddef.dpr
60 lines (54 loc) · 1.11 KB
/
make_speeddef.dpr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
program make_speeddef;
{$APPTYPE CONSOLE}
uses
SysUtils,
Classes;
var
fout: string;
i: integer;
sout: TStringList;
procedure AddFile(const fname: string);
var
x, y: integer;
sinp: TStringList;
s1, s2: string;
begin
sinp := TStringList.Create;
try
sinp.LoadFromFile(fname);
for x := 0 to sinp.Count - 1 do
begin
s1 := sinp.Strings[x];
s2 := '';
for y := 1 to Length(s1) do
begin
if s1[y] = '''' then
s2 := s2 + '''' + ''''
else
s2 := s2 + s1[y];
end;
sout.Add(' ''' + s2 + '''#13#10 +');
end;
finally
sinp.Free;
end;
end;
begin
{ TODO -oUser -cConsole Main : Insert code here }
fout := '';
for i := 0 to ParamCount - 1 do
if UpperCase(ParamStr(i)) = '-O' then
fout := ParamStr(i + 1);
if fout = '' then
begin
writeln('Please specify the output file (-o filename)');
halt(1);
end;
sout := TStringList.Create;
for i := 0 to ParamCount - 1 do
if UpperCase(ParamStr(i)) = '-I' then
AddFile(ParamStr(i + 1));
sout.Add(' '''';');
sout.SaveToFile(fout);
sout.Free;
end.