Hi all
I'm just trying to convert a Delphi program (non-visual) into GPC. I thought it would be much harder, but actually it's very easy. I have one problem though:
In Delphi they use AssignFile instead of Assign. I have defined a unit rtlib, where all Delphi-specific procedures are defined.
I first defined AssignFile as
procedure assignFile(var f : TextFile; fileName : string ); begin assign(f,filename); end; { assignFile }
However now I also need to define it with typed files. Is there a way to have more than one definition?
Best regards
Preben Bohn
PS. Yes, I could just replace AssignFile with Assign... :-)
===== The two rules for success are: 1. Never tell them everything you know.
____________________________________________________________ Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie
=?iso-8859-1?q?Preben=20Mikael=20Bohn?= wrote:
I'm just trying to convert a Delphi program (non-visual) into GPC. I thought it would be much harder, but actually it's very easy. I have one problem though:
In Delphi they use AssignFile instead of Assign. I have defined a unit rtlib, where all Delphi-specific procedures are defined.
Be welcome to contribute it (though some of them are already included with GPC, e.g. AssignFile is in the GPC unit, though with the same limitation you describe).
I first defined AssignFile as
procedure assignFile(var f : TextFile; fileName : string ); begin assign(f,filename); end; { assignFile }
However now I also need to define it with typed files. Is there a way to have more than one definition?
Not yet. We plan to allow `AnyFile' parameters which will accept, well, any file as a parameter and allow such operations that are defined on all file types (e.g. Assign).
Frank
In Delphi they use AssignFile instead of Assign. I have defined a unit rtlib, where all Delphi-specific procedures are defined.
Be welcome to contribute it (though some of them are already included with GPC, e.g. AssignFile is in the GPC unit, though with the same limitation you describe).
Well, right now it's only very few functions. I have some other functions, though, defined in some other units (e.g. IntToStr, etc), that I would be happy to contribute (I hope/guess Borland don't mind me using the same name and same functionality as their functions?).
For now I think I'll just search/replace AssignFile with Assign...
Best regards
Preben Bohn
PS. Where should I send my units? And are they at all needed?
===== The two rules for success are: 1. Never tell them everything you know.
____________________________________________________________ Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie