This is gpc.info, produced by makeinfo version 4.0 from gpc.texi.

INFO-DIR-SECTION GNU programming tools
START-INFO-DIR-ENTRY
* GPC: (gpc).                   The GNU Pascal Compiler.
END-INFO-DIR-ENTRY
INFO-DIR-SECTION Individual utilities
START-INFO-DIR-ENTRY
* GPC: (gpc)Invoking GPC.       The GNU Pascal Compiler.
END-INFO-DIR-ENTRY

   This file documents the GNU Pascal Compiler.

   Copyright (C) 1988, 1996-2000 Free Software Foundation, Inc.

   Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.

   Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided also
that the sections entitled "GNU General Public License", "The GNU
Project", "The GNU Manifesto" and "Funding for Free Software" are
included exactly as in the original, and provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.

   Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that the sections entitled "GNU General Public
License", "The GNU Project", "The GNU Manifesto" and "Funding for Free
Software" and this permission notice, may be included in translations
approved by the Free Software Foundation instead of in the original
English.


File: gpc.info,  Node: StdErr,  Next: Str,  Prev: static,  Up: Reference

StdErr
======

Synopsis
--------

     var
       StdErr: Text;

Description
-----------

   The `StdErr' variable is connected to the standard error file
handle. To report errors, you should prefer `WriteLn (StdErr,
'everything wrong')' over `WriteLn ('everything wrong')'.

Conforming to
-------------

   `StdErr' is a GNU Pascal extension.

Example
-------

     program StdErrDemo;
     var
       Denominator: Integer;
     begin
       ReadLn (Denominator);
       if Denominator = 0 then
         WriteLn (StdErr, ParamStr (0), ': division by zero')
       else
         WriteLn ('1 / ', Denominator, ' = ', 1 / Denominator)
     end.

See also
--------

   *Note StandardError::, *Note Output::, *Note Input::.


File: gpc.info,  Node: Str,  Next: String,  Prev: StdErr,  Up: Reference

Str
===

   (Under construction.)

Synopsis
--------

     procedure Str (x: INTEGER OR REAL; var Dest: String);
   or
     procedure Str (x: INTEGER OR REAL : FIELD WIDTH; var Dest: String);
   or
     procedure Str (x: Real : FIELD WIDTH : PRECISION; var Dest: String);
   or
     procedure Str (REPEATED CONSTRUCTS AS DESCRIBED ABOVE; var Dest: String);

Description
-----------

Conforming to
-------------

   `Str' is an UCSD Pascal extension, generalized by Borland Pascal.
The possibility to handle more than one variable with one call to `Str'
is a GNU Pascal extension.

   ISO-10206 Extended Pascal defines `WriteStr' instead of `Str'.

Example
-------

See also
--------

   *Note WriteStr::.


File: gpc.info,  Node: String,  Next: String2CString,  Prev: Str,  Up: Reference

String
======

   (Under construction.)

Synopsis
--------

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: String2CString,  Next: SubStr,  Prev: String,  Up: Reference

String2CString
==============

   (Under construction.)

Synopsis
--------

     function String2CString (const S: String): CString;

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: SubStr,  Next: Succ,  Prev: String2CString,  Up: Reference

SubStr
======

Synopsis
--------

     function SubStr (S: String; FirstChar: Integer): String;
   or
     function SubStr (S: String; FirstChar, Count: Integer): String;

Description
-----------

   `SubStr' returns a sub-string of S starting with the character at
position FIRSTCHAR.  If COUNT is given, such many characters will be
copied into the sub-string.  If COUNT is omitted, the sub-string will
will range to the end of S.

   If `Count' is too large for the sub-string to fit in S or if
`FirstChar' exceeds the length of S, `SubStr' triggers a runtime error.
(For a function returning the empty string instead, see *Note Copy::.)

Conforming to
-------------

   `SubStr' is a ISO 10206 Extended Pascal extension.

Example
-------

     program SubStrDemo;
     var
       S: String (42);
     begin
       S := 'Hello';
       WriteLn (SubStr (S, 2, 3));   { yields "ell" }
       WriteLn (SubStr (S, 3));      { yields "llo" }
       WriteLn (SubStr (S, 4, 7));   { yields a runtime error }
       WriteLn (SubStr (S, 42));     { yields a runtime error }
     end.

See also
--------

   *Note Copy::, String slice access.


File: gpc.info,  Node: Succ,  Next: Text,  Prev: SubStr,  Up: Reference

Succ
====

Synopsis
--------

     function Succ (i: ORDINAL TYPE): ORDINAL TYPE;
   or
     function Succ (i: ORDINAL TYPE; j: Integer): ORDINAL TYPE;

   or, with extended syntax (`--extended-syntax' or `{$X+}'),

     function Succ (p: POINTER TYPE): POINTER TYPE;
   or
     function Succ (p: POINTER TYPE; j: Integer): POINTER TYPE;

Description
-----------

   Returns the successor of the ORDINAL TYPE value `i', or, if the
second argument `j' is given, its `j'th successor.  For integer values
`i', this is `i + 1' (or `i + j').  (No, `Succ' does _not_ work faster
than plain addition.  Both are optimized to a single machine
instruction or even expanded by the compiler, if possible.)

   If extended syntax is on, the argument may also be a pointer value.
In this case, the address is incremented by the size of the variable
pointed to, or, if `j' is given, by `j' times the size of the variable
pointed to.  If `p' points to an element of an array, the returned
pointer will point to the (`j'th) next element of the array.

Conforming to
-------------

   The `Succ' function is defined in ISO-7185 Standard Pascal.  The
optional second parameter is defined in ISO-10206 Extended Pascal.
Application of `Succ' to pointers is defined in Borland Pascal.  The
combination of the second argument with application to pointers is a
GNU extension.

Example
-------

     program SuccDemo;
     
     type
       Metasyntactical = (foo, bar, baz);
     
     var
       m: Metasyntactical;
       c: Char;
       a: array [1 .. 7] of Integer;
       p: ^Integer;
     
     begin
       m := Succ (foo);     { bar }
       c := Succ ('A', 4);  { 'E' }
       a [1] := 42;
       a [2] := Succ (a [1]);     { 43 }
       a [5] := Succ (a [2], 7);  { 50 }
       {$X+}
       p := @a [1];
       p := Succ (p);     { points to `a [2]' now }
       p := Succ (p, 3);  { points to `a [5]' now }
     end.

See also
--------

   *Note Pred::, *Note Inc::, *Note Pointer Arithmetics::.


File: gpc.info,  Node: Text,  Next: TextWritable,  Prev: Succ,  Up: Reference

Text
====

   (Under construction.)

Synopsis
--------

     type
       Text  { built-in type }

Description
-----------

Conforming to
-------------

Example
-------

     program TextDemo;
     var
       t: Text;
     begin
       Rewrite (t, 'hello.txt');
       WriteLn (t, 'Hello, world!')
     end.

See also
--------


File: gpc.info,  Node: TextWritable,  Next: then,  Prev: Text,  Up: Reference

TextWritable
============

   (Under construction.)

Synopsis
--------

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: then,  Next: Time,  Prev: TextWritable,  Up: Reference

then
====

   (Under construction.)

Synopsis
--------

Description
-----------

Conforming to
-------------

Example
-------

     program ThenDemo;
     var
       i: Integer;
     begin
       Write ('Enter a number: ');
       ReadLn (i);
       if i > 42 then
         WriteLn ('The number is greater than 42')
     end.

See also
--------


File: gpc.info,  Node: Time,  Next: TimeStamp,  Prev: then,  Up: Reference

Time
====

   (Under construction.)

Synopsis
--------

     function Time (T: TimeStamp): packed array [1 .. TIME LENGTH] of Char;

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: TimeStamp,  Next: to,  Prev: Time,  Up: Reference

TimeStamp
=========

   (Under construction.)

Synopsis
--------

     type
       TimeStamp = {@@packed} record
         DateValid,
         TimeValid   : Boolean;
         Year        : Integer;
         Month       : 1 .. 12;
         Day         : 1 .. 31;
         DayOfWeek   : 0 .. 6;  { 0 means Sunday }
         Hour        : 0 .. 23;
         Minute      : 0 .. 59;
         Second      : 0 .. 61; { to allow for leap seconds }
         MicroSecond : 0 .. 999999
       end;

   (@@ Currently, in GPC, TimeStamp is not actually packed.)

   All fields except DayOfWeek and MicroSecond are required by Extended
Pascal.

   @@ `TimeStamp' may be later extended in GPC to contain the following
additional fields:

     Dst_used   : Boolean;  { If daylight savings are used }
     TimeZone   : Integer;  { Positive if west, in minutes }
     TimerValid : Boolean;  { Is the following timer valid }
     us_Timer   : Integer;  { A microsecond timer that is a 32 bit
                               modulus of the timer returned by the system. }

   Fields `Dst_used, TimeZone' and `DayOfWeek' will be valid when
`DateValid' is `True'. Field `us_Timer' will be valid when `TimerValid'
is `True'.

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: to,  Next: to begin do,  Prev: TimeStamp,  Up: Reference

to
==

   (Under construction.)

Synopsis
--------

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: to begin do,  Next: to end do,  Prev: to,  Up: Reference

to begin do
===========

   (Under construction.)

Synopsis
--------

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: to end do,  Next: Trim,  Prev: to begin do,  Up: Reference

to end do
=========

   (Under construction.)

Synopsis
--------

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: Trim,  Next: True,  Prev: to end do,  Up: Reference

Trim
====

   (Under construction.)

Synopsis
--------

     function Trim (S: String): String;

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: True,  Next: Trunc,  Prev: Trim,  Up: Reference

True
====

   (Under construction.)

Synopsis
--------

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: Trunc,  Next: Truncate,  Prev: True,  Up: Reference

Trunc
=====

Synopsis
--------

     function Trunc (x: Real): Integer;

Description
-----------

   `Trunc' converts `x' to the next integer below its argument (i.e.
truncates the numbers after the point).

Conforming to
-------------

   `Trunc' is defined in ISO-7185 Standard Pascal and supported by all
known Pascal variants.

Example
-------

     program TruncDemo;
     var
       Foo: Real;
     begin
       Foo := 9.876;
       WriteLn (Trunc (Foo))  { Prints 9 }
     end.

See also
--------

   *Note Round::.


File: gpc.info,  Node: Truncate,  Next: type,  Prev: Trunc,  Up: Reference

Truncate
========

   (Under construction.)

Synopsis
--------

     procedure Truncate (var F: ANY FILE);

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: type,  Next: type of,  Prev: Truncate,  Up: Reference

type
====

Synopsis
--------

   As a type declaration:
     type
       TYPE INDENTIFIER = TYPE DEFINITION;
   or with initialization:
     type
       TYPE INDENTIFIER = TYPE DEFINITION value CONSTANT EXPRESSION;

Description
-----------

   The reserved word `type' starts the declaration of a TYPE IDENTIFIER
which is defined by TYPE DEFINITION.  For further description see *Note
Type Declaration::, *Note Type Declaration::, *Note Type Definition::,
*Note Data Types::.

Conforming to
-------------

   `type' is defined in ISO-7185 Standard Pascal and supported by all
known Pascal variants. Initializers are an ISO-10206 Extended Pascal
extension.

Example
-------

     program TypeDemo;
     type
       { This side is the }    { That side is the }
       { type declaration }    { type definition  }
     
       { array type }
       ArrayType                  = array [0 .. 9] of Integer;
     
       { record type }
       RecordType                 = record
                                      bar: Integer
                                    end;
     
       { subrange type }
       SubrangeType               = -123 .. 456;
     
       { enumeration type }
       EnumeratedType             = (Mon, Tue, Wed, Thu, Fri,  Sat, Sun);
     
       { set type }
       CharSetType                = set of Char;
     
       { object type }
       ObjectType                 = object
                                      constructor Init;
                                      procedure Method;
                                      destructor Done
                                    end;
     
       { pointer type to another type identifier }
       PArrayType                 = ^ArrayType;
     
       { an alias name for another type identifier }
       IntegerType                = Integer;
     
       { an integer which is initialized by 123 }
       InitializedInt             = Integer value 123;
     
       { a schema with discriminants x and y of type Integer }
       SchemaType (x, y: Integer) = array [x .. y] of Integer;
     
     begin
     end.

See also
--------

   *Note Type Declaration::, *Note Type Definition::, *Note Data
Types::, *Note Variable Declaration::, *Note array::, *Note record::,
*Note object::, *Note set::, *Note Pointer::, *Note value::.


File: gpc.info,  Node: type of,  Next: TypeOf,  Prev: type,  Up: Reference

type of
=======

   (Under construction.)

Synopsis
--------

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: TypeOf,  Next: UnBind,  Prev: type of,  Up: Reference

TypeOf
======

Synopsis
--------

     function TypeOf (var x): Pointer;

Description
-----------

   Returns a pointer to the VMT of an _object_ type or variable.  This
pointer can be used to identify the type of an object.

Conforming to
-------------

   ISO Pascal does not define `TypeOf', Borland Pascal does.

Example
-------

     program TypeOfDemo;
     type
       FooPtr = ^Foo;
       BarPtr = ^Bar;
     
       Foo = object        { Has a VMT, though it doesn't }
         x: Integer;       { contain virtual methods.     }
         constructor Init;
       end;
     
       Bar = object (Foo)
         y: Integer;
       end;
     
     constructor Foo.Init;
     begin
     end;
     
     var
       MyFoo: FooPtr;
     
     begin
       MyFoo := New (BarPtr, Init);
       if TypeOf (MyFoo^) = TypeOf (bar) then  { True }
         WriteLn ('OK')
     end.

See also
--------

   *Note BitSizeOf::, *Note AlignOf::, *Note TypeOf::, *Note SetType::,
*Note OOP::.


File: gpc.info,  Node: UnBind,  Next: unit,  Prev: TypeOf,  Up: Reference

UnBind
======

   (Under construction.)

Synopsis
--------

     procedure UnBind (var F: ANY FILE);

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: unit,  Next: Unpack,  Prev: UnBind,  Up: Reference

unit
====

   (Under construction.)

Synopsis
--------

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: Unpack,  Next: until,  Prev: unit,  Up: Reference

Unpack
======

   (Under construction.)

Synopsis
--------

     procedure Unpack (Source: PACKED ARRAY;
                       var Dest: UNPACKED ARRAY;
                       FirstElement: INDEX TYPE);

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: until,  Next: UpCase,  Prev: Unpack,  Up: Reference

until
=====

   (Under construction.)

Synopsis
--------

Description
-----------

   `until' is part of the `repeat ... until' loop statement.

Conforming to
-------------

Example
-------

See also
--------

   *Note repeat::, *Note while::, *Note for::.


File: gpc.info,  Node: UpCase,  Next: Update,  Prev: until,  Up: Reference

UpCase
======

   (Under construction.)

Synopsis
--------

     function UpCase (Ch: Char): Char;

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: Update,  Next: uses,  Prev: UpCase,  Up: Reference

Update
======

   (Under construction.)

Synopsis
--------

     procedure Update (var F: ANY FILE);
   or
     procedure Update (var F: ANY FILE; FileName: String);

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: uses,  Next: Val,  Prev: Update,  Up: Reference

uses
====

Synopsis
--------

   In a program:

     program @@fragment foo;
     
     uses
       bar1,
       bar2 in 'baz.pas',
       bar3;
     
     [...]

   In a unit:

     unit @@fragment Bar3;
     
     interface
     
     uses
       bar1,
       bar2 in 'baz.pas';
     
     [...]
     
     implementation
     
     uses
       bar3,
       bar4 in 'qux.pas';
     
     [...]

Description
-----------

   The reserved word `uses' in the _import part_ of a program or unit
makes the program or unit import an interface.

   The keyword `in' tells GPC to look for the `unit' in the specified
file; otherwise the file name is derived from the name of the interface
by adding first `.p', then `.pas'.

   There must be at most one import part in a program.

   In a unit, there can be one import part in the interface part and
one in the implementation part.

   The imported interface needn't be an UCSD/Borland Pascal unit, it
may be an interface exported by an Extended Pascal module as well.

Conforming to
-------------

   ISO Pascal does not define `uses' and units at all. UCSD and Borland
Pascal do, but without the `in' extension. Delphi supports `uses' like
described above.

Example
-------

See also
--------

   *Note unit::, *Note module::, *Note import::.


File: gpc.info,  Node: Val,  Next: value,  Prev: uses,  Up: Reference

Val
===

   (Under construction.)

Synopsis
--------

     procedure Val (const Source: String; var x: INTEGER OR REAL);
   or
     procedure Val (const Source: String; var x: INTEGER OR REAL;
                    var ErrorCode: Integer);

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: value,  Next: var,  Prev: Val,  Up: Reference

value
=====

Synopsis
--------

Description
-----------

   The reserved word `value' is part of a type or var declaration.  It
can be replaced by `:=' or `='.

Conforming to
-------------

   `value' is an ISO-10206 Extended Pascal extension. `:=' in this
context is a VAX Pascal extension, and `=' is a Borland Delphi
extension.

Example
-------

See also
--------

   *Note var::, *Note type::, *Note Variable Declaration::, *Note Type
Declaration::.


File: gpc.info,  Node: var,  Next: view,  Prev: value,  Up: Reference

var
===

Synopsis
--------

   As part of a variable declaration part:
     var VARIABLE IDENTIFIER: TYPE IDENTIFIER;
   or
     var VARIABLE IDENTIFIER: TYPE DEFINITION;
   and with initializing value:
     var VARIABLE IDENTIFIER: TYPE IDENTIFIER value CONSTANT EXPRESSION;
   or
     var VARIABLE IDENTIFIER: TYPE DEFINITION value CONSTANT EXPRESSION;

As part of a parameter list:
     var VAR PARAMETER;
   or with type declaration
     var VAR PARAMETER: TYPE IDENTIFIER;

or with forced passing by reference:
     protected var VAR PARAMETER;
   or with type declaration
     protected var VAR PARAMETER: TYPE IDENTIFIER;

Description
-----------

   In a declaration part: The reserved word `var' declares a VARIABLE
IDENTIFIER whose type is of TYPE IDENTIFIER or which is defined by TYPE
DEFINITION.  For further description see *Note Variable Declaration::,
*Note Type Declaration::, *Note Type Definition::, *Note Data Types::.

   In a parameter list: see *Note Subroutine Parameter List
Declaration::.

Conforming to
-------------

   `var' is defined in ISO-7185 Standard Pascal and supported by all
known Pascal variants. Untyped `var' parameters in parameter lists are
a UCSD Pascal extension.

Example
-------

     program VarDemo;
     
     type
       FooType = Integer;
     
     var
       Bar: FooType;
       ArrayFoo: array [0 .. 9] of Integer;   { array var definition }
       FecordFoo: record                      { record var definition }
                    bar : Integer
                  end;
       CharsetFoo: set of Char;               { set var }
       SubrangeFoo: -123 .. 456;              { subrange var }
       EnumeratedFoo: (Mon, Tue, Wed, Thu, Fri, Sat, Sun);  {enumerated var }
       PointerBar: ^FooType;                  { pointer var }
     
     procedure ReadFoo (var foo: FooType);
     begin
       ReadLn (foo)
     end;
     
     begin
     end.

See also
--------

   *Note type::, *Note array::, *Note record::, *Note set::, *Note
Subrange Types::, *Note Pointer::, *Note protected::.


File: gpc.info,  Node: view,  Next: virtual,  Prev: var,  Up: Reference

view
====

   Not yet implemented.

Synopsis
--------

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: virtual,  Next: Void,  Prev: view,  Up: Reference

virtual
=======

   (Under construction.)

Synopsis
--------

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: Void,  Next: volatile,  Prev: virtual,  Up: Reference

Void
====

   (Under construction.)

Synopsis
--------

     type
       Void  { built-in type }

Description
-----------

Conforming to
-------------

Example
-------

     program VoidDemo;
     
     procedure p (var x : Void);
     begin
     end;
     
     var
       i: Integer;
       s: String (42);
     
     begin
       p (i);
       p (s)
     end.

See also
--------


File: gpc.info,  Node: volatile,  Next: while,  Prev: Void,  Up: Reference

volatile
========

   (Under construction.)

Synopsis
--------

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: while,  Next: with,  Prev: volatile,  Up: Reference

while
=====

Synopsis
--------

     while BOOLEAN EXPRESSION do
       STATEMENT

Description
-----------

   The `while' statement declares a loop. For further description see
*Note while Statement::.

Conforming to
-------------

   `while' is defined in ISO-7185 Standard Pascal and supported by all
known Pascal variants.

Example
-------

     program WhileDemo;
     var
       Foo, Bar: Integer;
     begin
       WriteLn ('Enter an descending series of integer numbers.');
       WriteLn ('Terminate by breaking this rule.');
       WriteLn ('Enter start number: ');
       Bar := MaxInt;
       ReadLn (Foo);
       while Foo < Bar do
         begin
           Bar := Foo;
           ReadLn (Foo)
         end;
       WriteLn ('The last number of your series was: ', Bar)
     end.

See also
--------

   *Note repeat Statement::, *Note for Statement::


File: gpc.info,  Node: with,  Next: Word,  Prev: while,  Up: Reference

with
====

   (Under construction.)

Synopsis
--------

Description
-----------

   _Note_: `with' statement overwrites program namespace.

Conforming to
-------------

Example
-------

   ...

   { Note bar is overwritten by foo.bar }  ...

See also
--------


File: gpc.info,  Node: Word,  Next: WordBool,  Prev: with,  Up: Reference

Word
====

Synopsis
--------

     type
       Word = Cardinal;
   or
     type
       Word (n) = Cardinal (n);

Description
-----------

   `Word' is the "natural" unsigned integer type in GNU Pascal.  On
most platforms it is 32 bits wide and thus has a range of
`0..4294967295'.  It is the same as *Note Cardinal::, introduced for
compatibility with other Pascal compilers.

   As an extension, GPC allows to use `Word' as a pseudo-schema to
produce types with a specified size in bits; for example

     type
       Word16 = Cardinal (16);

   defines an unsigned integer type with 16 bits.  The same mechanism
works for `Cardinal' and `Integer', too.

   `Word' in GNU Pascal is compatible to `unsigned int' in GNU C.

   There are lots of other integer types in GPC, see *Note Integer
Types::.

Conforming to
-------------

   ISO Pascal does not define `Cardinal'.  (However see *Note Subrange
Types::.)

   The `Word' type appears in Borland Pascal and Delphi, too, where it
is a 16-bit unsigned integer type.

Example
-------

     program WordDemo;
     var
       a: Word;
     begin
       a := 42;
       WriteLn (a)
     end.

See also
--------

   *Note Integer Types::, *Note Subrange Types::.


File: gpc.info,  Node: WordBool,  Next: Write,  Prev: Word,  Up: Reference

WordBool
========

   (Under construction.)

Synopsis
--------

     type
       WordBool = Boolean (BitSizeOf (Word));

Description
-----------

Conforming to
-------------

Example
-------

     program WordBoolDemo;
     var
       a: WordBool;
     begin
       Word (a) := 1;
       if a then WriteLn ('Ord (True) = 1')
     end.

See also
--------


File: gpc.info,  Node: Write,  Next: WriteLn,  Prev: WordBool,  Up: Reference

Write
=====

   (Under construction.)

Synopsis
--------

     procedure Write (var F: TYPED FILE; VARIABLE);
   or
     procedure Write (var F: Text; VALUES AND FORMAT SPECIFICATIONS);
   or
     procedure Write (VALUES AND FORMAT SPECIFICATIONS);

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: WriteLn,  Next: WriteStr,  Prev: Write,  Up: Reference

WriteLn
=======

   (Under construction.)

Synopsis
--------

     procedure WriteLn (var F: Text; VALUES AND FORMAT SPECIFICATIONS);
   or
     procedure WriteLn (VALUES AND FORMAT SPECIFICATIONS);

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: WriteStr,  Next: xor,  Prev: WriteLn,  Up: Reference

WriteStr
========

   (Under construction.)

Synopsis
--------

     procedure WriteStr (var Dest: String; VALUES AND FORMAT SPECIFICATIONS);

Description
-----------

Conforming to
-------------

Example
-------

See also
--------


File: gpc.info,  Node: xor,  Prev: WriteStr,  Up: Reference

xor
===

Synopsis
--------

     operator xor (operand1, operand2: Boolean) = Result: Boolean;
   or
     operator xor (operand1, operand2: INTEGER TYPE) = Result: INTEGER TYPE;
   or
     procedure xor (var operand1: INTEGER TYPE; operand2: INTEGER TYPE);

Description
-----------

   In GNU Pascal, `xor' has three built-in meanings:

  1. Logical "exclusive or" between two `Boolean'-type expressions.
     The result of the operation is of `Boolean' type.  (Logical `foo
     xor bar' in fact has the same effect as `foo <> bar'.)

  2. Bitwise "exclusive or" between two integer-type expressions.  The
     result is of the common integer type of both expressions.

  3. Use as a "procedure":  `operand1' is "xor"ed bitwise with
     `operand2'; the result is stored in `operand1'.


Conforming to
-------------

   ISO Pascal does not define the `xor' operator; Borland Pascal and
Delphi do.

   Use of `xor' as a "procedure" is a GNU extension.

Example
-------

     program XorDemo;
     var
       a, b, c: Integer;
     begin
       if (a = 0) xor (b = 0) then
         c := 1  { happens if either `a' or `b' is zero,    }
                 { but not if both are zero or both nonzero }
       else if a xor b = 0 then  { bitwise xor }
         c := 2  { happens if a = b }
       else
         xor (c, a)  { same as `c := c xor a' }
     end.

See also
--------

   *Note and::, *Note or::, *Note Operators::.


File: gpc.info,  Node: Keywords,  Next: Support,  Prev: Reference,  Up: Top

Pascal keywords and operators supported by GNU Pascal.
******************************************************

   This chapter lists all keywords understood by GNU Pascal.

   By default, keywords can be redefined to make it possible that every
correct ISO 7185 program can be compiled. However, you can use the
compiler dialect switches (e.g., `--extended-pascal' or
`--borland-pascal') to tell GPC that keywords of a given standard must
not be redefined.

   The keywords are taken from the following standards:

   * ISO 7185 Standard Pascal (SP)

   * ISO 10206 Extended Pascal (EP)

   * ANSI draft Object Pascal (OP)

   * USCD Pascal (USCD)

   * Borland Pascal 7.0 (BP)

   * Borland Delphi (BD)

   * Pascal-SC (PXSC, Pascal eXtensions for Scientific Calculations)

   * VAX Pascal (VP)

   * GNU Pascal extensions (GPC)

   In GPC you are free to re-define everything that is not a reserved
word in ISO 7185 Pascal in your program or the dialect selected.  E.g.,
you do not have to modify your code for GPC if you have an identifier
like `Restricted' or `Value' or some such, unless you compile with the
`--extended-pascal' option.

   The following table lists all known keywords with short
descriptions. The links point to the longer descriptions in the
reference.

absolute (BP, BD, GPC) (*note absolute::)
     overloaded variable declaration

abstract (OP, GPC) (*note abstract::)
     abstract object type declaration (not yet implemented)

all (GPC) (*note all::)
     `export' (*note export::) extension (`export foo = all')

and (any) (*note and::)
     Boolean or bitwise `and' operator or part of the `and then' (*note
     and then::) operator

and_then (EP, OP, GPC) (*note and_then::)
     short-circuit Boolean `and' (*note and::) operator

array (any) (*note array::)
     array type declaration

asm (BP, BD, GPC) (*note asm::)
     GNU style inline assembler code

asmname (GPC) (*note asmname::)
     linker name of routines and variables

attribute (GPC) (*note attribute::)
     attributes of routines and variables

begin (any) (*note begin::)
     begin of a code block, part of a `to begin do' (*note to begin
     do::) module constructor

bindable (EP, OP, GPC) (*note bindable::)
     external binding of files

case (any) (*note case::)
     multi-branch conditional statement or variant record type

class (OP, BD, GPC) (*note class::)
     OOE/Delphi style object classes (not yet implemented)

const (any) (*note const::)
     constant declaration or constant parameter declaration

constructor (OP, BP, BD, GPC) (*note constructor::)
     object constructor

destructor (OP, BP, BD, GPC) (*note destructor::)
     object destructor

div (any) (*note div::)
     integer or real division operator

do (any) (*note do::)
     part of a `while' (*note while::) or `for' (*note for::) loop, a
     `with' (*note with::) statement, or a `to begin do' (*note to
     begin do::) or `to end do' (*note to end do::) module constructor
     or destructor

downto (any) (*note downto::)
     part of a `for' (*note for::) loop when counting downwards

else (any) (*note else::)
     alternative part of an `if' (*note if::) statement, default case
     label or part of the `or else' (*note or else::) operator

end (any) (*note end::)
     end of a code block, end of a `case' (*note case::) statement, end
     of a record or object declaration, part of a `to end do' (*note to
     end do::) module destructor

export (EP, OP, BP, BD, GPC) (*note export::)
     module interface export

exports (BP, BD, GPC) (*note exports::)
     library export (not yet implemented)

external (EP, OP, UCSD, BP, BD, GPC) (*note external::)
     declaration of external objects

file (any) (*note file::)
     non-text file type declaration

for (any) (*note for::)
     loop statement where the number of loops is known in advance

forward (UCSD, BP, BD, GPC) (*note forward::)
     declaration of a routine whose definition follows below

function (any) (*note function::)
     function declaration

goto (any) (*note goto::)
     statement to jump to a `label' (*note label::)

if (any) (*note if::)
     conditional statement

import (EP, OP, GPC) (*note import::)
     module interface import

implementation (EP, OP, UCSD, BP, BD, GPC) (*note implementation::)
     module or unit implementation part

in (any) (*note in::)
     set membership test or part of a `for' (*note for::) loop when
     iterating through sets

inherited (OP, BP, BD, GPC) (*note inherited::)
     reference to methods of ancestor object types

inline (GPC) (*note inline::)
     declaration of inline routines

interface (EP, OP, UCSD, BP, BD, GPC) (*note interface::)
     module or unit interface part

interrupt (BP, BD) (*note interrupt::)
     interrupt handler declaration (not yet implemented)

is (OP, BD, GPC) (*note is::)
     object type membership test (not yet implemented)

label (any) (*note label::)
     label declaration for a `goto' (*note goto::) statement

library (BP, BD, GPC) (*note library::)
     library declaration (not yet implemented)

mod (any) (*note mod::)
     integer remainder operator

module (EP, OP, GPC) (*note module::)
     EP style or PXSC style (only partially implemented) modules

nil (any) (*note nil::)
     reserved value for unassigned pointers

not (any) (*note not::)
     Boolean or bitwise `not' operator

object (BP, BD, GPC) (*note object::)
     BP style object declaration

of (any) (*note of::)
     part of an array, set or typed file type declaration, a `case'
     (*note case::) statement, a variant record type or a `type of'
     (*note type of::) type inquiry

only (EP, OP, GPC) (*note only::)
     import specification

operator (PXSC, GPC) (*note operator::)
     operator declaration

or (any) (*note or::)
     Boolean or bitwise `or' operator or part of the `or else' (*note
     or else::) operator

or_else (EP, OP, GPC) (*note or_else::)
     short-circuit Boolean `or' (*note or::) operator

otherwise (EP, OP, GPC) (*note otherwise::)
     default case label

packed (any) (*note packed::)
     declaration of packed record or array types, also packed ordinal
     subranges

pow (EP, OP, GPC) (*note pow::)
     exponentiation operator with integer exponent

private (BP, BD, GPC) (*note private::)
     private object fields

procedure (any) (*note procedure::)
     procedure declaration

program (any) (*note program::)
     start of a Pascal program

property (OP, BD, GPC) (*note property::)
     variable properties (not yet implemented)

protected (EP, OP, BD, GPC) (*note protected::)
     read-only formal parameters and protected object fields

public (BP, BD, GPC) (*note public::)
     public object fields

published (BP, BD, GPC) (*note published::)
     published object fields

qualified (EP, OP, GPC) (*note qualified::)
     import specification

record (any) (*note record::)
     structured type declaration

repeat (any) (*note repeat::)
     loop statement

resident (BP, BD) (*note resident::)
     library export specification (not yet implemented)

restricted (EP, OP, GPC) (*note restricted::)
     type specification

segment (UCSD) (*note segment::)
     segment specification (not yet implemented)

set (any) (*note set::)
     set type declaration

shl (BP, BD, GPC) (*note shl::)
     bitwise left shift operator

shr (BP, BD, GPC) (*note shr::)
     bitwise right shift operator

static (GPC) (*note static::)
     static variable declaration

then (any) (*note then::)
     part of an `if' (*note if::) statement or part of the `and then'
     (*note and then::) operator

to (any) (*note to::)
     part of a `for' (*note for::) loop when counting upwards or a `to
     begin do' (*note to begin do::) or `to end do' (*note to end do::)
     module constructor or destructor

type (any) (*note type::)
     type declaration or part of a `type of' (*note type of::) type
     inquiry

unit (UCSD, BP, BD, GPC) (*note unit::)
     UCSD and BP style unit declaration

until (any) (*note until::)
     end of a `repeat' (*note repeat::) statement

uses (UCSD, BP, BD, GPC) (*note uses::)
     unit import

value (EP, OP, GPC) (*note value::)
     variable initializer

var (any) (*note var::)
     variable declaration or reference parameter declaration

view (OP, GPC) (*note view::)
     object class view (not yet implemented)

virtual (OP, BP, BD, GPC) (*note virtual::)
     virtual object method declaration

volatile (GPC) (*note volatile::)
     volatile variable declaration

while (any) (*note while::)
     loop statement

with (any) (*note with::)
     automatic record or object field access

xor (BP, BD, GPC) (*note xor::)
     Boolean or bitwise `exclusive or' operator


File: gpc.info,  Node: Support,  Next: To Do,  Prev: Keywords,  Up: Top

Where to get support for GNU Pascal; how to report bugs.
********************************************************

   Here you can find information on where to find the most up-to-date
information about GPC, how you can get support (professional or
voluntary), how to use GPC's Test Suite, and how to report new bugs you
might encounter.

   If you have problems with GNU Pascal, please read the relevant
sections of the GPC Manual. The most current version of the manual is
available at
`http://agnes.dida.physik.uni-essen.de/~gnu-pascal/gpc-doc.html' for
online browsing.  You can also download the complete manual in HTML
format (tar.gz) (`gpc-html.tar.gz' on GPC's WWW home page).  The manual
is also available in DVI format (gzipped) (`gpc.dvi.gz' on GPC's WWW
home page) and PostScript format (gzipped) (`gpc.ps.gz' on GPC's WWW
home page) for printing.

   If the manual doesn't help you, here is what we recommend you to do:

*Note FAQ::                Check the GPC FAQ

* Menu:

* Mailing List::           Join the GPC Mailing List
* Mailing List Archives::  Look in the Mailing List Archives
* Newsgroups::             Ask in a newsgroup
* Professional Support::   Get individual support for GPC
* Compiler Crashes::       If the compiler crashes...
* Reporting Bugs::         Find out how to report GPC bugs
* Testing::                If you have GPC sources, learn how to run
                           the Test Suite to test your bugs reported


File: gpc.info,  Node: Mailing List,  Next: Mailing List Archives,  Up: Support

The GPC Mailing List
====================

   There is a mailing list devoted to GNU Pascal. You can write to the
mailing list, e.g. if you have problems installing GPC or if you found
a problem with GPC (please see *Note Reporting Bugs::). You can also
use it to discuss suggestions for improving GPC and, most welcome, to
offer your help or contribute code, documentation or other work. Mails
to the list should be in English.

   To subscribe to the mailing list, send the command
     subscribe gpc your@email.address
   in the body of a mail to <majordomo@gnu.de> (*not* to
`gpc@gnu.de'!). The subject is ignored. (Please replace
`your@email.address' with your real email address.) For more info, send
a line `help' to <majordomo@gnu.de>.

   You can send a message to the mailing list by sending email to the
list address <gpc@gnu.de> as if it were a person.

   To leave the mailing list, send the command
     unsubscribe gpc your@email.address
   to <majordomo@gnu.de>.

   There is also a (low-traffic) announce list, <gpc-announce@gnu.de>
that you can subscribe to stay up-to-date. To subscribe to the list,
write an email with
     subscribe gpc-announce your@email.address
   in the body to <majordomo@gnu.de>. If you like to announce a
contribution, a service or an event related to GPC, you are invited to
post to this list rather than `gpc@gnu.de', but please don't use the
announce list for questions or discussions. Please note that all mail
sent to the announce list is forwarded to the regular list, so you
won't have to subscribe to both lists if you don't want to miss
anything.


File: gpc.info,  Node: Mailing List Archives,  Next: Newsgroups,  Prev: Mailing List,  Up: Support

The GPC Mailing List Archives
=============================

   Perhaps your problem was already discussed on the list. There is a
searchable archive of the mailing list on the WWW. It can be browsed or
searched at `http://www.gnu.de/archive/wilma.cgi/gpc'.

   The archive of the GPC announcement list is at
`http://www.gnu.de/archive/wilma.cgi/gpc-announce'.

   _Note:_ Currently, the search option is working fine. If you find it
broken, please email me at <anja@drewitz.de>. Please don't mail a copy
to the GPC list because I let procmail move all mails with `To: gpc...'
and `Cc: gpc...' to a separate folder and would not see your mail for a
long time. -- Anja

   This archive starts in June 1999. For older messages, see:

     `ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/misc/gpc-list-1998.gz'
     (513 kB)
     `ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/misc/gpc-list-1997.gz'
     (995 kB)
     `ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/misc/gpc-list-1996.gz'
     (154 kB)
     `ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/misc/gpc-list-1995.gz'
     (42 kB)

   There is also a HTML version of these older archives at
`http://www.iula.upf.es/altres/pub/gpc/list2html/gpclist.htm'.


File: gpc.info,  Node: Newsgroups,  Next: Professional Support,  Prev: Mailing List Archives,  Up: Support

Newsgroups relevant to GPC
==========================

   To get support, you can also ask the Usenet newsgroups for help.
There are several Pascal related newsgroups, but none is dedicated just
to GNU Pascal, so use the one which is most appropriate for your
problem. For general Pascal questions, we recommend the following one:

`news://comp.lang.pascal.misc'       Pascal in general and ungrouped
                                     Pascals.

   Pascal syntax related questions may be appropriate in:

`news://comp.lang.pascal.ansi-iso'   Pascal according to ANSI and ISO
                                     standards.

   The next newsgroup is a haven for beginners, answering questions
that would apply to almost any Pascal. However, if you have a
GPC-specific question don't post there - use the GPC mailing list.  And
when in doubt use the GPC mailing list.

`news://comp.lang.pascal.borland'    Borland Pascal questions.

   Don't forget to give back what you have obtained. None of us is
getting money for answering your questions (unless you pay us by
yourself). Please do your part by answering the questions of others
instead.


File: gpc.info,  Node: Professional Support,  Next: Compiler Crashes,  Prev: Newsgroups,  Up: Support

Where to get individual support for GPC
=======================================

   GPC is free software and comes *without any warranty*.

   If you want to get professional support, you can hire an individual
or a company for providing such a service.

   G-N-U GmbH (http://www.g-n-u.de) is doing large parts of the
development of GNU Pascal. This company offers special support for GPC
and can be contacted at <info@g-n-u.de>.

   More generally, to find a company or an individual who offers
support and other consulting services for free software, look into the
GNU Service Directory (http://www.gnu.org/prep/service.html).


File: gpc.info,  Node: Compiler Crashes,  Next: Reporting Bugs,  Prev: Professional Support,  Up: Support

If the compiler crashes...
==========================

   If the compiler crashes, you have discovered a bug. A reliable
compiler never crashes. To help the maintainers fix this bug, it is
important that you send us a problem report.

   If you're on Unix, you can find out where the compiler crashed if
you enable coredumps, then load the compiler (`gpc1') plus the core
file in the debugger (`gdb /your_path_here/gpc1 core'), then type
`backtrace' to get a stacktrace. Include this stacktrace in your bug
report.


File: gpc.info,  Node: Reporting Bugs,  Next: Testing,  Prev: Compiler Crashes,  Up: Support

How to report GPC bugs
======================

   If you encounter a bug with GPC, please check whether it is one of
the known bugs (*note Known Bugs::). If not, please report it to the
GNU Pascal mailing list (*note Mailing List::). That way, they always
reach the maintainers. Please note the following points.

   * Please send a description of the problem. Try to give as much
     information as possible, with the full text of any error messages
     encountered, or a description of how some output varies from the
     expected output. Always specify the operating system type with
     version and the machine type (try `uname -a' if unsure) as well as
     the version of GPC as printed by `gpc -v'.

   * A good article on submitting bug reports can be found at either
     `http://www.chiark.greenend.org.uk/~sgtatham/bugs.html' or
     `http://freshmeat.net/news/2000/02/26/951627540.html'


   If the problem is with the compiler itself, not an installation
problem or something like this, please provide a test program to
reproduce the problem, and note the following hints. You can also
contribute test programs for features that are working in GPC to ensure
they will not break in future releases.

   * The test program should be as short as possible, but *by all
     means*, please send a *complete* program and *make sure* that it
     still reproduces the problem before you send it. Too often, users
     have sent code which contained obvious syntax errors far before
     the actual problem, or just code fragments we could only make wild
     guesses about. This is unproductive for us and doesn't help you
     get your problem solved.


   The preferred form for test programs is the form that the automated
GPC Test Suite understands. Please, if at all possible, send your test
programs in this form which should be easy to do, so we won't have to
waste our time to bring them into this form, and can concentrate on
fixing the problem.

   * The file containing the main program must contain the keyword
     `program' (case-insensitively) to be recognized by the testing
     script. Other files, which can contain units or modules or data
     needed by the program, must not contain the word `program'.

   * Since the Test Suite must run under very ... nah ... strange
     operating systems, too, file names must be distinguished in their
     first eight characters (case-insensitively) and should not contain
     anything but letters, numbers, hyphens, underscores and a single
     dot. The extension must be `.pas' to be recognized by the testing
     script. Furthermore, any ancillary files (units, modules,
     includes, data files) should not be longer than "8+3" characters.
     It is often a good idea to use your name, nickname or initials
     followed by a number as the file name.

   * The test program, when run, should produce a line of output
     consisting of the string `OK' (followed by a newline) if
     everything went as expected, and something else (e.g. `failed',
     possibly followed by the reason of failure) if something went
     wrong.

   * However, if the program is intended to check whether GPC catches an
     (intentional) error in the program, place the string `WRONG'
     somewhere in the test program, preferably in a comment in the line
     that contains the intentional error, and make the program output
     `failed' or something like this if it does compile mistakenly.


   The following special features of the testing script may be helpful
for constructing tests:

   * If the expected output is something else than `OK', place it in a
     file `<basename>.out' (where `<basename>' is the name of the test
     program without the `.pas' extension).

   * If the test program expects some input, place it in a file
     `<basename>.in'. It will automatically be redirected to the
     program's standard input.

   * If the test needs some special flags to be given to the GPC command
     line, place them in a comment preceded by `FLAG', e.g.:

          (* FLAG --extended-pascal -Werror *)

   * The source file name of the test program will be passed as the
     first command-line argument to the test program run.

   * If a test needs to be run in a special way, you can accompany the
     program with a script `<basename>.run' that will do the actual
     test after the test program was compiled. This script will be run
     by `sh' (regardless of its first line). In order to be portable,
     it should only use standard tools. The source file name of the test
     program will be passed as the first command-line argument to the
     run script in this case. The compiled file is always called
     `a.out'.

   * If a test needs to be compiled in a special way (e.g., to decide
     whether to skip the test), place the commands in a script
     (preferably called `<basename>.cmp'), and put the file name of the
     script (without directory) in a comment preceded by `COMPILE-CMD:'
     into the source of the test program. The compile script will be
     run *instead* of any other action for this test program, so it
     gives you maximum flexibility to do whatever you need to do. This
     script will be run by `sh' (regardless of its first line). In
     order to be portable, it should only use standard tools.  The
     first command-line argument to the compile script will be the
     compiler to use, including all options. The second argument will be
     the source file name of the test program. For some typical tests,
     there are standard compile scripts, e.g. `i386.cmp' which will
     skip the test unless run on an i386 compatible processor. This is
     necessary, e.g., when testing assembler code. Of course, it's still
     better to avoid having to use such scripts when possible.


