On Thu, 19 Jun 1997 03:22:55 +0200 Frank Heckenbach heckenb@mi.uni-erlangen.de wrote:
[...]
The African Chief wrote:
{$ifdef _Borland_16_Bit_}
Is this defined by default in your unit?
No. The definition is commented out (with a dot before the "$")
(Otherwise it might be confusing for BP->gpc programmers.)
BP->GPC programmers (like me) may want BP syntax support, but not necessarily want to use 16-bit data structures instead of the default ones. It is quite easy to remove the dot.
Ok, so by default the unit uses data types like BP, but it can be changed, right?
I am not sure I understand what you mean. However, the idea is this. GPC is a 32-bit compiler that wants to support the BP syntax; so we try to do support the *syntax* - thereby helping BP folks to move their programs to 32-bit.; so we keep the data structures in their 32-bit format - but, if, for some reason, a person who wants to move his 16-bit programs to 32-bit with GPC still wants his data types to be exactly as they are in a 16-bit compiler, then he has to remove a dot on one line in the unit wherein the data types are defined, and recompile his program.
BTW: I just took a look at BPCompat1.0. Just a few quick comments:
- How about some sub-directories (perhaps according to the 5 sections
of files in *.txt)? Would help in order to see immediately what's needed for "only" BP compatibility, and what's additional functionality.
Yes, that will happen in the next release.
- Concerning FindFirst and FindNext in Dos: is there any reason why
they're functions, not procedures?
Delphi?
Yes.
If so, perhaps dependent on a compiler switch?
At present, no.
(Is there a way to test in a program, if "--borland-pascal" or "--delphi" was given?)
I know of none.
Otherwise, you'll always get warnings in BP programs (and I don't think it's a good idea to disable warnings globally).
True enough. In BP, when {$X+} is used, you can use functions just like procedures. Perhaps Peter can add this to GPC as well, so that no warning is generated in such instances? If this happens, then we don't need to turn off warnings.
- If you want to use my random functions in System, you're welcome to
include them, of course. (Perhaps one day we can claim "100% BP compatibility -- even the random numbers are the same..." ;-).
Okay, thanks. I will see if I can add it. AFAICR your unit uses some ASM statements. Are we sure that ASM code in GPC will stand the test of time? (I have some programs which use a lot of 8086 asm code, and it is impossible to port these to Delphi 2 ...).
As a preliminary solution for the overloading problem, one could use the (case-sensitive!) preprocessor, as by defining "{$define random RandReal}". Then "random" would be for real types, and all other cases for integers. (Or perhaps vice versa? Or all-caps?) At least, programs could be the same for BP and gpc in this respect. :-)
The problem with $define is that it does not export from units. Will this be a problem?
Best regards, The Chief Dr Abimbola A. Olowofoyeku (The African Chief, and the Great Elephant) Author of: Chief's Installer Pro v3.60 for Win16 and Win32. Homepage: http://ourworld.compuserve.com/homepages/African_Chief/ E-mail: laa12@cc.keele.ac.uk