Sign in Join
Wiki copytemporary

DOS2MAC/de: what changed

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

Title: DOS2MAC/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 DOS-Format in das MAC-Format.
4+
5+``` pascal
6+uses
7+ FileUtil, ...;
8+
9+ ...
10+
11+procedure subDOS2MAC(const conStrQuellDateiname, conStrZielDateiname: string);
12+// konvertiert Zeilenumbrüche von Windows, DOS, OS/2, CP/M oder TOS (Atari) nach
13+// Mac OS (bis Version 9), Apple II, 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+ begin
34+ Continue;
35+ end;
36+
37+ Write(txtZieldatei, chrZeichen);
38+
39+ end;
40+
41+ closefile(txtQuelldatei);
42+ closefile(txtZieldatei);
43+
44+end;
45+```
46+
47+Aufruf unter DOS, Windows:
48+
49+``` pascal
50+ subDOS2MAC('E:\Test_alt.txt', 'E:\Test_neu.txt');
51+```
52+
53+Aufruf unter Linux:
54+
55+``` pascal
56+ subDOS2MAC('/home/user/Test_alt.txt', '/home/user/Test_neu.txt');
57+```
58+
59+---
60+*From the Free Pascal wiki, page "DOS2MAC/de", as it stood on 2020-02-13 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