Sign in Join
Wiki copytemporary

MAC2DOS/de: what changed

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

Title: MAC2DOS/de

OldNewLine
1+Zurück zur Seite [[Newline/de|Zeilenumbruch / Newline]].
2+
3+Das Unterprogramm konvertiert die Zeilenumbrüche einer ASCII- bzw. ANSI-Textdatei vom MAC-Format in das DOS-Format.
4+
5+``` pascal
6+uses
7+ FileUtil, ...;
8+
9+ ...
10+
11+procedure subMAC2DOS(const conStrQuellDateiname, conStrZielDateiname: string);
12+// konvertiert Zeilenumbrüche von Mac OS bis Version 9, Apple II, C64 nach
13+// Windows, DOS, OS/2, CP/M oder TOS (Atari)
14+var
15+ txtQuelldatei: file of char;
16+ txtZieldatei: file of char;
17+ chrZeichen: char;
18+
19+begin
20+ assignfile(txtQuelldatei, UTF8ToSys(conStrQuellDateiname));
21+ assignfile(txtZieldatei, UTF8ToSys(conStrZielDateiname));
22+ Rewrite(txtZieldatei);
23+ Reset(txtQuelldatei);
24+ Reset(txtZieldatei);
25+
26+ while not EOF(txtQuelldatei) do
27+ begin
28+
29+ Read(txtQuelldatei, chrZeichen);
30+
31+ if (chrZeichen = #13) then
32+ begin
33+ Write(txtZieldatei, chrZeichen);
34+ Write(txtZieldatei, #10);
35+ Continue;
36+ end;
37+
38+ Write(txtZieldatei, chrZeichen);
39+
40+ end;
41+
42+ closefile(txtQuelldatei);
43+ closefile(txtZieldatei);
44+end;
45+```
46+
47+Aufruf unter DOS, Windows:
48+
49+``` pascal
50+ subMAC2DOS('E:\Test_alt.txt', 'E:\Test_neu.txt');
51+```
52+
53+Aufruf unter Linux:
54+
55+``` pascal
56+ subMAC2DOS('/home/user/Test_alt.txt', '/home/user/Test_neu.txt');
57+```
58+
59+---
60+*From the Free Pascal wiki, page "MAC2DOS/de", as it stood on 2020-02-19 after a change by Trev, 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).*

Back to history