gpc/15: Emulation of Borland Pascal 'Assign' procedure does not work in separate unit_(re)

Sun, 12 Jan 1997 12:03:47 +0100 (MET)


Hello, Axel!

> Emulation of the Borland Pascal 'Assign' procedure (as suggested in
> the gpc.info) does not work if the 'Assign' procedure is put into a
> separate unit.

The problem is that String types without specified length do not
(yet!;-) survive the transport through a GPI file.

Workaround: Use Strings with specified length:

> (* begin 'borland.pas' - this goes into a separate file *)
> unit borland;
> 
> INTERFACE

  type
    mystring = string (255);

  procedure Assign(var t: text; protected Name: mystring);

> IMPLEMENTATION

  procedure Assign(var t: text; protected Name: mystring);
> var
>   b: BindingType;
> begin
>   unbind(t);
>   b := binding(t);
>   b.Name := Name;
>   bind(t, b);
>   b := binding(t);
> end;
> 
> end.
> (* end 'borland.pas' *)

However, thanks a lot for the bug report.  Without such reports,
we would probably never be able to make GPC a stable compiler.

Greetings,

    Peter

      e-mail:  peter.gerwinski@uni-essen.de
home address:  D\"usseldorfer Str. 35, 45145 Essen, Germany
         WWW:  http://agnes.dida.physik.uni-essen.de/~peter/


Peter Gerwinski (peter@agnes.dida.physik.uni-essen.de)

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