4 function CreatePNFile(filename : string; Text : pChar) : Boolean;
5 function StripNewLines(aString: string): string;
6 procedure ConvertTypes(filename : string);
7 const strFileTypes : PChar = ('.txt');
8 strOpenTypes : PChar = ('%2|Text files (*.txt)|*.txt|0|0|0|LOG files (*.log)|*.log|0|0|0|Executable Files (*.exe, *.com, *.dll)|*.exe;*.com;*.dll|0|0|0');
13 function CreatePNFile(filename : string; Text : pChar) : Boolean;
16 AssignFile(F, filename);
20 If IOResult <> 0 Then Result := False
23 function StripNewLines(aString: string): string;
28 while i <= length(aString) do
30 if aString[i] = #13 then result := result + ' ' else
31 if aString[i] <> #10 then result := result + aString[i];
35 procedure ConvertTypes(filename : string);
38 ps : string; {part of string}
47 OutStr := VerChar + CurrFileVer;
48 if not fileexists(filename) then
50 CreatePNFile(filename, strOpenTypes);
53 Assignfile(t, FileName);
57 until (Length(s) > 0) or EOF(t);
62 iPos := Pos(SepChar, s);
63 if (iPos = 0) and (Length(s) > 0) then
68 ps := Copy(s, 1, ipos - 1);
69 s := Copy(S, ipos + 1, Length(s));
72 OutStr := OutStr + SepChar + ps;
76 OutStr := OutStr + SepChar + ps;
80 OutStr := OutStr + SepChar + ps + SepChar + '0' + SepChar + '0';
85 Assignfile(t, filename);