Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2000-09

append below mail, compiler directive...

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

KO Myung-Hun

Hi.

I forgot about compiler directive problem.

If setting to {$MODE DELPHI}, locate {$H-} directive above 'program' or 'interface' sentence, {$H-} ignored.

Below is a simple test program.

--------
{$MODE DELPHI}
{$H-}
program ShortStringProblem;
var
    S : string;
begin
    WriteLn( SizeOf( S ));
end.
-------

If this program run correctly, size of short string, 256, should be printed. But result that we can get is '4', size of pointer, so ansistring.

But If {$H-} is located below 'program' or 'interface' or {$MODE DELPHI} is removed, {$H-} operated correctly.

For better FPC !!!

from KO Myung-Hun...

Reply by email