Sign in Join
Wiki copytemporary

Ansi2OEM/de: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-\
21Zurück zur Seite [[code examples/de|Code Beispiele]].\
3-\
2+
43Dieser Artikel beschäftigt sich mit der Windowsprogrammierung.\
54Das Unterprogramm konvertiert eine Datei vom Ansi-Zeichensatz in den OEM-Zeichensatz (DOS und Windowskonsole).\
65
76``` pascal
87uses
98 Windows, FileUtil, ...;
109
1110 ...
1211
1312procedure subAnsi2OEM(const conStrQuellDateiname, conStrZielDateiname: string);
1413
1514implementation
1615
1716procedure subAnsi2OEM(const conStrQuellDateiname, conStrZielDateiname: string);
1817// konvertiert eine Datei mit Ansi-Zeichensatz in den OEM-Zeichensatz
1918var
2019 txtQuelldatei: file of char;
2120 txtZieldatei: file of char;
2221 chrZeichen: char;
2322 strPuffer: string;
2423
2524begin
2625
2726 assignfile(txtQuelldatei, UTF8ToSys(conStrQuellDateiname));
2827 assignfile(txtZieldatei, UTF8ToSys(conStrZielDateiname));
2928 Rewrite(txtZieldatei);
3029 Reset(txtQuelldatei);
3130 Reset(txtZieldatei);
3231
3332 while not EOF(txtQuelldatei) do
3433 begin
3534
3635 Read(txtQuelldatei, chrZeichen);
3736
3837 strPuffer := chrZeichen + #0;
3938 CharToOEM(PChar(strPuffer), @chrZeichen);
4039
4140 Write(txtZieldatei, chrZeichen);
4241
4342 end;
4443
4544 closefile(txtQuelldatei);
4645 closefile(txtZieldatei);
4746
4847end;
4948```
5049
51-\
5250Aufruf unter Windows:
5351
5452``` pascal
5553 subAnsi2OEM('E:\Test_alt.txt', 'E:\Test_neu.txt');
5654```
5755
58-\
59-\
6056--Olaf 08:45, 24 March 2014 (CET)
6157
6258---
6359*From the Free Pascal wiki, page "Ansi2OEM/de", as it stood on 2020-02-09 after a change by GAN, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
6460Category: Code Snippets/de
6561Category: Deutsch

Back to history