External variables and constants

Eike Lange eike.lange at uni-essen.de
Tue Mar 18 14:08:57 CET 2003


On Tue, Mar 18, 2003 at 01:37:31PM +0100, Adriaan van Os wrote:
> Is it correct that an external variable can be declared in GPC as 
> follows:
>   var eV: integer; external; asmname 'eV';

Yes. In future releases, this statement might be
  var
    Foo: Integer; external name 'Bar';

> Is there a similar construct to declare external constants ('extern 
> const' in C) ?

Not as constants.
In C:
  baz.c
  const int _c_bar = 42;
In GNU Pascal (future release):
  baz.pas
  var
    Foo: const Integer; external name '_c_bar';

(As far as I remember)

A disadvantage of those constants is, that you cannot use them in
a `case' statement.

Eike




More information about the Gpc mailing list