Re: gpc/15: Emulation of Borland Pascal 'Assign' procedure does not work in separate unit
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/
participants (1)
-
Peter Gerwinski