Bug with text files

Fri, 20 Jun 1997 11:59:12 +0200



The following works as a program, but not as a unit (used e.g. by an empty
program). It gives the following runtime message (DJGPP and Linux):

?GPC runtime error: (gpc-rts) _p_initfdr() has not been called for file (#701)

{$define u}
{$IFDEF u}
UNIT printer;
INTERFACE
{$ENDIF}

USES System;

VAR Lst:Text;

{$IFDEF u}
IMPLEMENTATION
TO BEGIN DO
{$ENDIF}
BEGIN
  Assign(Lst,'LPR');
  Rewrite(Lst);
  writeln(Lst,'Test');
  Close(Lst)
{$IFDEF u}
END;
{$ENDIF}
END.

Apropos: Did anyone write a portable printer unit yet?
-- 
Frank Heckenbach, Erlangen, Germany
heckenb@mi.uni-erlangen.de
Turbo Pascal:   http://www.mi.uni-erlangen.de/~heckenb/programs.htm
Internet links: http://www.mi.uni-erlangen.de/~heckenb/links.htm


Frank Heckenbach (heckenb@mi.uni-erlangen.de)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es