Dr A Olowofoyeku (The African Chief) wrote:
Your program works okay - and, you will be happy to hear, I have found the cause of the bug. It was caused by this statement in the initialization section of SYSTEM.PAS;
FMode := L_Binary;
I have now removed it.
That's fine! One bug less! :-)
Now, this takes me to another point. I need to remove the statement in SYSTEM.PAS that redefines "String" as "bpString" if "_Borland_Pascal_" is defined. This would of course change the definition of all those functions in the unit that either take "String" as parameters, or that return type "String". The question is, what should I change them to? Since this is a bpCompat unit, I could change all of them to "bpString" (or "ShortString", which is currently defined as "bpString"), or I could just leave them as "String", which might mean warnings, etc., and the compiler defaulting to a 255 character length. What do people think? A new version of bpCompat is imminent, and I need to resolve this issue.
Well, first of all, string parameters (value, var and const) are OK and should work. (Internally not exactly the same as in BP, but a (well-written) Pascal procedure shouldn't notice the difference.)
So the problem concerns only strings as function results and possibly pointer types to strings. In this case, MHO is to change them to bpString because I know that you'll keep an eye on the library, and change them back to String when this will be supported.
For other programs, the programmers must decide for themselves whether to use a fixed size string if they're ready to change it back when possible, or to use String and stand some warnings in the meantime.
(Of course, warnings can be turned off globally, but as I said on another occasion, I don't like this idea very much.)
Frank