Prof Abimbola Olowofoyeku wrote:
On 23 Mar 2002 at 15:35, Frank Heckenbach wrote:
[...]
No, why? For BP compatibility, it should be enough to treat `String' as `String[255]'
It isn't enough.
Yes, it is. As I said, GPC currently does *not* do so in all contexts yet.
Maybe this is just a question of words and meanings - but I think you just said that it is not enough ;-).
Did I? How should I have expressed better that I didn't mean this? (Unfortunately, there doesn't be an English translation of the German word "doch". ;-)
Anyway, I meant that it is enough to treat `String' as `String[255]' (which GPC does not yet always do).
So you can see that GPC, on this issue, is entirely in a class of its own (i.e., not compatible with any other Pascal compiler in any respect - and certainly not with BP).
Come on, please! First of all, comparing `SizeOf' is not a good idea because it depends too much on the internal structure.
Of course. It is simply to illustrate that BP (and compatible compilers) treat a string literal passed as a parameter as a 255 character string.
They don't do anything special with string literals. The difference is that they interpret `String' in the formal parameter (and elsewhere) as `String[255]' while GPC interprets it as an undiscriminated string (which BP & Co. don't have).
Secondly, what exactly do you mean with "any other Pascal compiler"?
The ones I just referred to.
Which are certainly not any other Pascal compilers.
AFAICS, you only compared GPC's standard conformant behaviour to three nonstandard compilers (which are all modelled after each other, so the fact that they behave the same doesn't tell much about whether that's a good behaviour). Any EP conformant compiler will behave like GPC does (except that `SizeOf' is nonstandard itself, but one can see it, e.g., testing the Capacity).
We were talking about BP string compatibility.
Then I guess what you meant to say is that BP and compatibles are a class of their own, and you'd like GPC to emulate their non-standard behaviour. ;-)
In generally, I have agreed that we should add this feature (via the switch). However, I don't consider it as important as many other things to do, so the chances that I will do it soon are rather small ...
Frank