Sign in Join
Wiki copytemporary

Ansi2OEM/de: what changed

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

Title: Ansi2OEM/de

OldNewLine
1+\
2+Zurück zur Seite [[code examples/de|Code Beispiele]].\
3+\
4+Dieser Artikel beschäftigt sich mit der Windowsprogrammierung.\
5+Das Unterprogramm konvertiert eine Datei vom Ansi-Zeichensatz in den OEM-Zeichensatz (DOS und Windowskonsole).\
6+
7+``` pascal
8+uses
9+ Windows, FileUtil, ...;
10+
11+ ...
12+
13+procedure subAnsi2OEM(const conStrQuellDateiname, conStrZielDateiname: string);
14+
15+implementation
16+
17+procedure subAnsi2OEM(const conStrQuellDateiname, conStrZielDateiname: string);
18+// konvertiert eine Datei mit Ansi-Zeichensatz in den OEM-Zeichensatz
19+var
20+ txtQuelldatei: file of char;
21+ txtZieldatei: file of char;
22+ chrZeichen: char;
23+ strPuffer: string;
24+
25+begin
26+
27+ assignfile(txtQuelldatei, UTF8ToSys(conStrQuellDateiname));
28+ assignfile(txtZieldatei, UTF8ToSys(conStrZielDateiname));
29+ Rewrite(txtZieldatei);
30+ Reset(txtQuelldatei);
31+ Reset(txtZieldatei);
32+
33+ while not EOF(txtQuelldatei) do
34+ begin
35+
36+ Read(txtQuelldatei, chrZeichen);
37+
38+ strPuffer := chrZeichen + #0;
39+ CharToOEM(PChar(strPuffer), @chrZeichen);
40+
41+ Write(txtZieldatei, chrZeichen);
42+
43+ end;
44+
45+ closefile(txtQuelldatei);
46+ closefile(txtZieldatei);
47+
48+end;
49+```
50+
51+\
52+Aufruf unter Windows:
53+
54+``` pascal
55+ subAnsi2OEM('E:\Test_alt.txt', 'E:\Test_neu.txt');
56+```
57+
58+\
59+\
60+--Olaf 08:45, 24 March 2014 (CET)
61+
62+---
63+*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).*
64+Category: Code Snippets/de
65+Category: Deutsch

Back to history