Sign in Join
Wiki copytemporary

UNIX2MAC/de: what changed

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

Title: UNIX2MAC/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 UNIX-Format in das MAC-Format.\
4+
5+``` pascal
6+uses
7+ FileUtil, ...;
8+
9+ ...
10+
11+procedure subUNIX2MAC(const conStrQuellDateiname, conStrZielDateiname: string);
12+// konvertiert Zeilenumbrüche von Unix, Linux, Android, Mac OS X, AmigaOS, BSD, usw. ... nach
13+// Mac OS (bis Version 9), Apple II und C64
14+var
15+ txtQuelldatei: file of char;
16+ txtZieldatei: file of char;
17+ chrZeichen: char;
18+
19+begin
20+
21+ assignfile(txtQuelldatei, UTF8ToSys(conStrQuellDateiname));
22+ assignfile(txtZieldatei, UTF8ToSys(conStrZielDateiname));
23+ Rewrite(txtZieldatei);
24+ Reset(txtQuelldatei);
25+ Reset(txtZieldatei);
26+
27+ while not EOF(txtQuelldatei) do
28+ begin
29+
30+ Read(txtQuelldatei, chrZeichen);
31+
32+ if (chrZeichen = #10) then
33+ Write(txtZieldatei, #13)
34+ else
35+ Write(txtZieldatei, chrZeichen);
36+
37+ end;
38+
39+ closefile(txtQuelldatei);
40+ closefile(txtZieldatei);
41+
42+end;
43+```
44+
45+Aufruf unter DOS, Windows:
46+
47+``` pascal
48+ subUNIX2MAC('E:\Test_alt.txt', 'E:\Test_neu.txt');
49+```
50+
51+Aufruf unter Linux:
52+
53+``` pascal
54+ subUNIX2MAC('/home/user/Test_alt.txt', '/home/user/Test_neu.txt');
55+```
56+
57+---
58+*From the Free Pascal wiki, page "UNIX2MAC/de", as it stood on 2020-03-03 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