PC to/from MAC file converter
I happened to write my diploma thesis on a MAC while having a PC. The text file
format is slightly different, but convertable. The code here is able to convert
text in both ways.
It applies only for ASCII files, no Word stuff or such.
{
CommandLine : PCMAC src dst [TOMAC/TOPC]
}
{$F+}
PROGRAM PCtoMAC;
USES OPCRT;
VAR src,dst:String;
tomac:BOOLEAN;
PROCEDURE copy(src,dst:STRING);
VAR s,d:FILE OF BYTE;
l:BYTE;
BEGIN
Assign(s,src);
Reset(s);
Assign(d,dst);
Rewrite(d);
WHILE NOT EOF(s) DO
BEGIN
Read(s,l);
{ to mac : remove LF }
IF (tomac) THEN
BEGIN
IF (l<>10) THEN
BEGIN
CASE l OF
$84:l:=$8A; {„}
$94:l:=$9A; {”}
$81:l:=$9F; {