@c This is going to become a language reference for GPC.
@c Started on 27 Apr 1997 by Peter Gerwinski, <peter.gerwinski@uni-essen.de>
@c Re-started on 31 Jul 1997 by Peter Gerwinski, <peter@gerwinski.de>

@node Reference
@chapter The Alphabetical GPC Language Reference

@tex
%
% Save old definitions manually rather than using grouping.
%
\global\let\unnumberedsubseczzzsave\unnumberedsubseczzz
\global\let\unnumberedsecsave\unnumberedsec
%
% Add a \fillbreak, a somewhat stronger
% version of \filbreak, to \unnumberedsec.
%
\gdef\fillbreak{\par\vfill\penalty-500\vskip0pt plus 1fil}
\gdef\unnumberedsec{\fillbreak\parsearg\unnumberedsecyyy}
%
% Don't write unnumbered subsections into the table of contents.
%
\gdef\plainsubsecheading #1{\subsecheadingi {#1}}
\gdef\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
\plainsubsecheading {#1}\gdef\thissection{#1}%
{\chapternofonts%
\edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
\escapechar=`\\%
% Don't do this!
% \write \contentsfile \temp %
\unnumbnoderef %
\penalty 10000 %
}}
@end tex

@strong{This chapter is under development, so don't be too excited about the
paragraph below!}

This chapter contains an alphabetical list of all built-in identifiers of
the GNU Pascal compiler.  It does not cover extensions provided by external
libraries which are supposed to come with their own documentation.

@c This table indeed lists all identifiers currently recognized
@c *and supported* by GPC.
@c
@c Most of the entries point into Nirvana.  Once we have documented all
@c of the below, we have a more-or-less complete documentation for GPC.

@menu
* abs::
* absolute::
* addr::
* AlignOf::
* all::
* and::
* and then::
* and_then::
* AnsiChar::
* append::
* arctan::
* arg::
* array::
* asm::
* asmname::
* Assign::
* assigned::
* attribute::
* begin::
* Bind::
* bindable::
* Binding::
* BindingType::
* BitSizeOf::
* BlockRead::
* BlockWrite::
* Boolean::
* break::
* Byte::
* ByteBool::
* ByteCard::
* ByteInt::
* C::
* C_Language::
* Card::
* Cardinal::
* case::
* Char::
* ChDir::
* chr::
* close::
* cmplx::
* Comp::
* Complex::
* Concat::
* conjugate::
* Const::
* Constructor::
* continue::
* Copy::
* cos::
* CString::
* CString2String::
* Date::
* dec::
* default::
* DefineSize::
* Delete::
* Destructor::
* Dispose::
* div::
* do::
* Double::
* downto::
* else::
* empty::
* end::
* eof::
* eoln::
* EpsReal::
* eq::
* erase::
* Exit::
* exp::
* Export::
* extend::
* Extended::
* extern::
* external::
* false::
* far::
* File::
* FileMode::
* FilePos::
* FileSize::
* FillChar::
* flush::
* for::
* forward::
* frac::
* FreeMem::
* Function::
* ge::
* Get::
* GetFile::
* GetMem::
* GetTimeStamp::
* goto::
* gt::
* Halt::
* high::
* if::
* Im::
* import::
* Implementation::
* in::
* inc::
* Index::
* inherited::
* inline::
* InOutRes::
* InOutResStr::
* Input::
* Insert::
* int::
* Integer::
* Interface::
* IOresult::
* Label::
* LastPosition::
* le::
* length::
* ln::
* LoCase::
* LongCard::
* LongInt::
* LongestCard::
* LongestInt::
* LongestReal::
* LongestWord::
* LongReal::
* LongWord::
* low::
* lt::
* Mark::
* max::
* MaxChar::
* MaxInt::
* MaxReal::
* MedCard::
* MedInt::
* MedReal::
* MedWord::
* min::
* MinReal::
* MkDir::
* mod::
* Module::
* move::
* MoveLeft::
* MoveRight::
* near::
* ne::
* New::
* NewCString::
* Nil::
* not::
* NULL::
* object::
* odd::
* of::
* only::
* Operator::
* or::
* or else::
* or_else::
* ord::
* others::
* otherwise::
* Output::
* pack::
* packed::
* page::
* pAnsiChar::
* ParamCount::
* ParamStr::
* pChar::
* Pointer::
* polar::
* pos::
* Position::
* pow::
* pred::
* Procedure::
* Program::
* protected::
* PtrCard::
* PtrInt::
* PtrWord::
* Put::
* Re::
* read::
* readln::
* ReadStr::
* Real::
* record::
* Release::
* rename::
* repeat::
* reset::
* restricted::
* Result::
* return::
* rewrite::
* RmDir::
* round::
* RunError::
* Seek::
* SeekRead::
* SeekUpdate::
* SeekWrite::
* Self::
* set::
* SetLength::
* SetType::
* ShortCard::
* ShortInt::
* ShortReal::
* ShortWord::
* Single::
* shl::
* shr::
* sin::
* SizeOf::
* SmallInt::
* sqr::
* sqrt::
* StandardError::
* StandardInput::
* StandardOutput::
* static::
* StdErr::
* Str::
* StrPCopy::
* String::
* String2CString::
* SubStr::
* succ::
* Text::
* then::
* Time::
* TimeStamp::
* to::
* to begin::
* to end::
* Trim::
* true::
* trunc::
* Truncate::
* Type::
* TypeOf::
* UnBind::
* Unit::
* unpack::
* until::
* UpCase::
* update::
* uses::
* Val::
* value::
* Var::
* virtual::
* Void::
* while::
* with::
* Word::
* write::
* writeln::
* WriteStr::
* xor::
@end menu


@c ============================================================================


@node abs
@unnumberedsec abs
@cindex abs

@unnumberedsubsec Syntax

@smallexample
  Function abs ( i: @var{integer type} ): @var{integer type};
@end smallexample
or
@smallexample
  Function abs ( x: @var{real type} ): @var{real type};
@end smallexample
or
@smallexample
  Function abs ( z: @var{complex type} ): @var{real type};
@end smallexample

@unnumberedsubsec Description

Returns the absolute value of the argument.  For integer or real
values of @samp{x}, the definition is

@smallexample
  Function abs ( x: @var{integer or real type} ): @var{integer or real type};

  begin (* abs *)
    if x < 0 then
      abs:= -x
    else
      abs:= x;
  end (* abs *);
@end smallexample

whereas for complex values it is

@smallexample
  Function abs ( x: Complex ): Complex;

  begin (* abs *)
    abs:= sqrt ( x * conjugate ( x ) );
  end (* abs *);
@end smallexample

@unnumberedsubsec Standards

The function @samp{abs} is defined in ISO-7185 Standard Pascal;
its application to complex values is defined in ISO-10206 Extended Pascal.

@unnumberedsubsec Example

@smallexample
  Program TestAbs;

  Var
    i1: Complex;

  begin
    writeln ( abs ( 42 ) );             (* 42    *);
    writeln ( abs ( -42 ) );            (* 42    *);
    writeln ( abs ( -12.1 ) : 0 : 1 );  (* 12.1  *);
    i1:= cmplx ( 1, 1 );                (* 1 + i *)
    writeln ( abs ( i1 ) : 0 : 3 );     (* 1.414, i.e. sqrt ( 2 ) *)
  end.
@end smallexample

@unnumberedsubsec See also

@ref{sqr}.


@c ----------------------------------------------------------------------------


@node absolute
@unnumberedsec absolute
@cindex absolute

@unnumberedsubsec Syntax

@smallexample
  Var
    @var{variable name}: @var{data type} absolute @var{variable reference};
@end smallexample
or
@smallexample
  Var
    @var{variable name}: @var{data type} absolute @var{integer expression};
@end smallexample

@unnumberedsubsec Description

The first meaning of the @samp{absolute} directive allows to put a variable
to the address of another one and thus provides a type-casting mechanism.

In most cases, @var{variable reference} will be just a variable name, but
GPC also allows arbitrary expressions here.  If @var{variable reference} has
neither a constant address nor is a variable parameter, GPC prints a warning.
This warning is suppressed in ``extended syntax'' mode which is switched on
by the @samp{--extended-syntax} option or the @samp{(*$X+*)} compiler directive.

Other type-casting mechanisms in GPC are variant records (which are valid in
ISO-7185 Standard Pascal) and explicit type casts.

The second meaning of @samp{absolute} places a variable at a specified
address.  This is useful on machines without virtual memory addressing for
doing certain low-level operations, but should be avoided on systems with
memory protection such as UNIX-like systems.  GPC does not check whether the
specified virtual address makes any sense and does not provide a built-in
mechanism to map it to a real address.  

GPC warns about this second use of @samp{absolute} unless ``extended syntax''
has been requested.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{absolute}.

Borland Pascal does define @samp{absolute} but has a slightly different
syntax for the second meaning related to the addressing scheme of
Intel X86 processors working in real mode.

Allowing arbitrary memory references instead of just variable names
in the first meaning of @samp{absolute} is a GNU extension.

@unnumberedsubsec Example

@example
  Program TestAbsolute;

  (*$X+*)

  Const
    IOmemory = $F0000000;

  Var
    Mem: array [ 0..MaxInt ] of Byte absolute 0;
    SomeIOport: Byte absolute IOmemory + $C030;

  (* Beware:  Using any of the variables above will crash    *)
  (* your program unless you know exactly what you do!       *)
  (* That's why GPC warns about it without the X+ directive. *)

  Var
    x: Real;
    a: array [ 1..SizeOf ( Real ) ] of Byte absolute x;
    i: Integer;

    b: Byte absolute a [ i ];
    (* GNU extension: non-constant memory reference. *)

  begin
    x:= 3.14;
    (* Gather at the internal representation of a real variable. *)
    for i:= 1 to SizeOf ( Real ) do
      write ( a [ i ] : 4 );   (* Or (kind of abuse): `write ( b );' *)
    writeln;      
  end.
@end example

@unnumberedsubsec See also

@ref{record}, @ref{Type casts}.


@c ----------------------------------------------------------------------------

@node addr
@unnumberedsec addr
@cindex addr

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function addr ( Const Foo ): Pointer;
@end smallexample
@cindex foo

@unnumberedsubsec Description

@samp{addr} returns the address of its argument.

@unnumberedsubsec Standards

@samp{assigned} is a Borland Pascal extension.

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node AlignOf
@unnumberedsec AlignOf
@cindex AlignOf
@cindex alignment

@unnumberedsubsec Syntax

@smallexample
  Function AlignOf ( Var x ): Integer;
@end smallexample

@unnumberedsubsec Description

Returns the alignment of a type or variable in bytes.

@unnumberedsubsec Standards

@samp{AlignOf} is a GNU extension.

@unnumberedsubsec Example

@example
  Var
    a: Integer;
    b: array [ 1..8 ] of Char;

  @dots{}

  writeln ( AlignOf ( a ) );  (* Alignment of `Integer'; usually 4 bytes. *)
  writeln ( AlignOf ( b ) );  (* Alignment of `Char'; usually 1 byte. *)
@end example

Although the array is bigger than a single char, it is accessed char by char,
so there usually is no need to align it on a 4 byte boundary or such.  (This
may be false on some platforms.)

@unnumberedsubsec See also

@ref{SizeOf}, @ref{BitSizeOf}, @ref{TypeOf}.


@c ----------------------------------------------------------------------------


@node all
@unnumberedsec all
@cindex all

@unnumberedsubsec Description

@samp{all} is a predefined export interface for Extended Pascal modules.
You can use it to export all identifiers declared in an interface module
automatically.

@unnumberedsubsec Standards

@samp{all} is a GNU extension.

@unnumberedsubsec Example

@example
  Module TestAll Interface;

  export
    foo = all;  (* Same as `foo = ( a, b, bar );' *)

  Var
    a, b: Integer;

  Procedure bar;

  end.
@end example

@unnumberedsubsec See also

@ref{Modules}.


@c ----------------------------------------------------------------------------


@node and
@unnumberedsec and
@cindex and

@unnumberedsubsec Syntax

@smallexample
  Operator and ( operand1, operand2: Boolean ) = result: Boolean;
@end smallexample
or
@smallexample
  Operator and ( operand1, operand2: @var{integer type} ) = result: @var{integer type};
@end smallexample
or
@smallexample
  Procedure and ( Var operand1: @var{integer type}; operand2: @var{integer type} );
@end smallexample

@unnumberedsubsec Description

In GNU Pascal, @samp{and} has three built-in meanings:

@enumerate

@item
Logical ``and'' between two @samp{Boolean}-type expressions.
The result of the operation is of @samp{Boolean} type.

By default, @samp{and} acts as a short-circuit operator in GPC:  If the first
operand is @samp{false}, the second operand is not evaluated because the result
is already known to be @samp{false}.  You can change this to complete
evaluation using the @samp{--no-short-circuit} command-line option or the
@samp{(*$B+*)} compiler directive.

@item
Bitwise ``and'' between two integer-type expressions.
The result is of the common integer type of both expressions.

@item
Use as a ``procedure'':  @samp{operand1} is ``and''ed bitwise with
@samp{operand2}; the result is stored in @samp{operand1}.

@end enumerate

@unnumberedsubsec Standards

The logical @samp{and} operator is defined in ISO-7185 Standard Pascal.

According to ISO, you cannot rely on @samp{and} being a short-circuit
operator.  On the other hand, GPC's default behaviour does @emph{not}
contradict the ISO standard.  (See @ref{and_then}.)  However, since it seems
to be a de-facto standard among ISO Pascal compilers to evaluate both operands
of @samp{and}, GPC switches to @samp{--no-short-circuit} mode if one of the
language dialect options selecting ISO Pascal, for instance
@samp{--extended-pascal}, is given.  Use @samp{--short-circuit} to override.

ISO Pascal does not define the bitwise @samp{and} operator; Borland Pascal and
Delphi do.

Use of @samp{and} as a ``procedure'' is a GNU extension.

@unnumberedsubsec Example

@example
  Var
    a, b, c: Integer;

  @dots{}

  if ( a = 0 ) and ( b = 0 ) then  (* logical `and' *)
    c:= 1
  else if a and b = 0 then  (* bitwise `and' *)
    c:= 2
  else
    and ( c, a );  (* same as `c:= c and a' *)
@end example

Note the difference between the logical @samp{and} and the bitwise
@samp{and}:  When @samp{a} is 2 and @samp{b} is 4, then @samp{a and b} is 0.
@strong{Beware:}  @samp{a and b = 0} has nothing to do with
@samp{( a = 0 ) and ( b = 0 )}!

Since bitwise @samp{and} has a higher priority than the @samp{=} operator,
parentheses are needed in @samp{if ( a = 0 ) and ( b = 0 )} because otherwise
@samp{0 and b} would be calculated first, and the remainder would cause a
parse error.

@unnumberedsubsec See also

@ref{and_then}, @ref{and then}, @ref{or}, @ref{xor}, @ref{Operators}.


@c ----------------------------------------------------------------------------


@node and then
@unnumberedsec and then
@cindex and then

@unnumberedsubsec Description

@samp{and then} is an alias for the short-circuit logical operator
@samp{and_then}.

@unnumberedsubsec Standards

While @samp{and_then} is defined in ISO-10206 Extended Pascal,
@samp{and then} is a GNU Extension.

@unnumberedsubsec Example

@example
  Var
    p: ^Integer;

  [...]

  if ( p <> Nil ) and then ( p^ < 42 ) then  (* This is safe. *)
    [...];
@end example

@unnumberedsubsec See also

@ref{and_then}, @ref{and}, @ref{or else}.


@c ----------------------------------------------------------------------------


@node and_then
@unnumberedsec and_then
@cindex and_then

@unnumberedsubsec Syntax

@smallexample
  Operator and_then ( operand1, operand2: Boolean ) = result: Boolean;
@end smallexample

@unnumberedsubsec Description

The @samp{and_then} short-circuit logical operator performs the same
operation as the logical operator @samp{and}.  But while the ISO
standard does not specify anything about the evaluation of the operands
of @samp{and}---they may be evaluated in any order, or not at
all---@samp{and_then} has a well-defined behaviour:  It evaluates the
first operand.  If the result is @samp{false}, @samp{and_then} returns
@samp{false} without evaluating the second operand.  If it is @samp{true},
the second operand is evaluated and returned.

Since the behaviour described above is the most effective way to implement
@samp{and}, GPC by default treats @samp{and} and @samp{and_then} exactly the
same.  If you want, for some reason, to have both operands of @samp{and}
evaluated completely, you can specify the @samp{--no-short-circuit}
command-line option, but this is not portable.  The portable way to have both
operands evaluated is to assign both to temporary variables and then use
@samp{and}---or @samp{and_then}, it does not matter.

@unnumberedsubsec Standards

ISO-7185 Standard Pascal does not define @samp{and_then};
ISO-10206 Extended Pascal does.

Some people think that the ISO standard requires both operands of @samp{and}
to be evaluated.  This is false.  What the ISO standard @emph{does} say is
that you cannot rely on a certain order of evaluation of the operands of
@samp{and}; in particular things like

@example
  Var
    p: ^Integer;

  [...]

  if ( p <> Nil ) and ( p^ < 42 ) then
    [...];
@end example

@noindent
can crash according to ISO Pascal, although they cannot crash when compiled
with GNU Pascal running in default mode.

If you want to write portable and efficient code in ISO-10206 Extended Pascal,
@emph{always} use @samp{and_then}; @emph{never} use @samp{and}.

@unnumberedsubsec Example

@example
  Var
    p: ^Integer;

  [...]

  if ( p <> Nil ) and_then ( p^ < 42 ) then  (* This is safe. *)
    [...];
@end example

@unnumberedsubsec See also

@ref{and then}, @ref{and}, @ref{or_else}.


@c ----------------------------------------------------------------------------


@node AnsiChar
@unnumberedsec AnsiChar
@cindex AnsiChar

@unnumberedsubsec Syntax

@smallexample
  Type
    AnsiChar = Char;
@end smallexample

@unnumberedsubsec Description

@samp{AnsiChar} is an 8 bit char type.  Currently, it is the same as
@samp{Char}, but this might change in the future, once @samp{wide chars}
(16 bit chars) will be introduced into GPC.  Depending on the platform,
@samp{Char} might be either @samp{AnsiChar} or @samp{WideChar} then.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{AnsiChar}; Delphi does.

@unnumberedsubsec Example

@example
  Var
    A: AnsiChar;  (* There is nothing special with `AnsiChar'. *)
    B: Char;

  [...]

  A:= 'A';
  A:= B;
@end example

@unnumberedsubsec See also

@ref{pAnsiChar}, @ref{Char}.


@c ----------------------------------------------------------------------------


@node append
@unnumberedsec append
@cindex append

@unnumberedsubsec Syntax

@smallexample
  Procedure append ( Var F: @var{any file} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@samp{append} is a Borland Pascal extension.  ISO-10206 Extended Pascal
has @ref{extend} instead.

@unnumberedsubsec Example

@unnumberedsubsec See also

@ref{Assign}, @ref{reset}, @ref{rewrite}, @ref{update}, @ref{extend}.


@c ----------------------------------------------------------------------------


@node arctan
@unnumberedsec arctan
@cindex arctan

@unnumberedsubsec Syntax

@smallexample
  Function arctan ( x: Real ): Real;
@end smallexample
or
@smallexample
  Function arctan ( z: Complex ): Complex;
@end smallexample

@unnumberedsubsec Description

@samp{arctan} returns the (principal value of the) arcus tangent of the
argument.  The result is in the range @samp{-pi / 2 < arctan ( x ) < pi / 2}
for real arguments.

@unnumberedsubsec Standards

The function @samp{arctan} is defined in ISO-7185 Standard Pascal;
its application to complex values is defined in ISO-10206 Extended Pascal.

@unnumberedsubsec Example

@example
  writeln ( 4 * arctan ( 1 ) : 0 : 5 );
  (* yields 3.14159; arctan ( 1 ) = pi / 4. *)
@end example

@unnumberedsubsec See also

@ref{sin}, @ref{cos}, @ref{ln}, @ref{arg}.


@c ----------------------------------------------------------------------------


@node arg
@unnumberedsec arg
@cindex arg

@unnumberedsubsec Syntax

@smallexample
  Function arg ( z: Complex ): Real;
@end smallexample

@unnumberedsubsec Description

@samp{arg} returns the complex ``argument'', i.e.@: the angle (in radian) 
in the complex plane with respect to the real axis, of its parameter @samp{z}.
The result is in the range of @samp{-pi < arg ( z ) <= pi}.

@unnumberedsubsec Standards

ISO-7185 Standard Pascal does not define @samp{arg};
ISO-10206 Extended Pascal does.

@unnumberedsubsec Example

@example
  Program TestArg;

  Var
    z: Complex;

  begin
    z:= cmplx ( 1, 1 );  (* 1 + i *)
    writeln ( arg ( z ) : 0 : 5 );
    (* yields 0.78540, i.e. pi / 4. *)
  end.
@end example

@unnumberedsubsec See also

@ref{arctan}, @ref{ln}, @ref{polar}.


@c ----------------------------------------------------------------------------


@node array
@unnumberedsec array
@cindex array

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node asm
@unnumberedsec asm
@cindex asm

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node asmname
@unnumberedsec asmname
@cindex asmname

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Assign
@unnumberedsec Assign
@cindex Assign

@unnumberedsubsec Syntax

@smallexample
  Procedure Assign ( Var F: @var{any file}; FileName: String );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@samp{Assign} is a Borland Pascal extension.

@unnumberedsubsec Example

@unnumberedsubsec See also

@ref{reset}, @ref{rewrite}, @ref{update}, @ref{extend}, @ref{append}.


@c ----------------------------------------------------------------------------


@node assigned
@unnumberedsec assigned
@cindex assigned

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function assigned ( p: Pointer ): Boolean;
@end smallexample
or
@smallexample
  Function assigned ( p: @var{procedural type} ): Boolean;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@samp{assigned} is a Borland Pascal extension.

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node attribute
@unnumberedsec attribute
@cindex attribute

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node begin
@unnumberedsec begin
@cindex begin

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Bind
@unnumberedsec Bind
@cindex Bind

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure Bind ( Var F: @var{any file}; B: BindingType );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node bindable
@unnumberedsec bindable
@cindex bindable

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Binding
@unnumberedsec Binding
@cindex Binding

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function Binding ( F: @var{any file} ): BindingType;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node BindingType
@unnumberedsec BindingType
@cindex BindingType

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
UnixTimeType = LongInt;

GPC_BindingType = @{@@@@packed@} record
                    Bound             : Boolean;
                    Force             : Boolean;      @{ Can be set to allow binding to non-writable files or directories @}
                    Extensions_Valid  : Boolean;
                    Readable          : Boolean;
                    Writable          : Boolean;
                    Executable        : Boolean;
                    Existing          : Boolean;      @{ Binding points to an existing file @}
                    Directory         : Boolean;      @{ Binding points to an existing directory; Existing is False then @}
                    Size              : LongInt;      @{ Number of elements or -1 @}
                    AccessTime,                       @{ Time of last access @}
                    ModificationTime,                 @{ Time of last modification @}
                    ChangeTime        : UnixTimeType; @{ Time of last change @}
                    Error             : Integer;      @{ Unused currently @}
                    CFile             : CFilePtr;     @{ allows binding a Pascal file to a C file @}
                    Name              : String (Binding_Name_Length)
                  end;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node BitSizeOf
@unnumberedsec BitSizeOf
@cindex BitSizeOf
@cindex bits

@unnumberedsubsec Syntax

@smallexample
  Function BitSizeOf ( Var x ): Integer;
@end smallexample

@unnumberedsubsec Description

Returns the size of a type or variable in bits.

@unnumberedsubsec Standards

@samp{BitSizeOf} is a GNU extension.

@unnumberedsubsec Example

@example
  Var
    a: Integer;
    b: array [ 1..8 ] of Char;
    c: Integer ( 12 );

    d: packed record
      x: Integer ( 12 );
      y: 0..3;
    end (* d *);

  @dots{}

  writeln ( BitSizeOf ( a ) );  (* Size of an `Integer'; usually 32 bits.  *)
  writeln ( BitSizeOf ( b ) );  (* Size of eight `Char's; usually 64 bits. *)
  writeln ( BitSizeOf ( c ) );  (* 16 bits (smallest addressable space).   *)

  writeln ( BitSizeOf ( d ) );    (* 16 *)
  writeln ( BitSizeOf ( d.x ) );  (* 12 *)
  writeln ( BitSizeOf ( d.y ) );  (*  2 *)
@end example

@unnumberedsubsec See also

@ref{SizeOf}, @ref{AlignOf}, @ref{TypeOf}.


@c ----------------------------------------------------------------------------


@node BlockRead
@unnumberedsec BlockRead
@cindex BlockRead

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure BlockRead ( Var F: File; Var Buffer; Blocks: Integer );
@end smallexample
or
@smallexample
  Procedure BlockRead ( Var F: File; Var Buffer; Blocks: Integer;
                        Var BlocksRead: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node BlockWrite
@unnumberedsec BlockWrite
@cindex BlockWrite

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure BlockWrite ( Var F: File; Const Buffer; Blocks: Integer );
@end smallexample
or
@smallexample
  Procedure BlockWrite ( Var F: File; Const Buffer; Blocks: Integer;
                         Var BlocksWritten: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Boolean
@unnumberedsec Boolean
@cindex Boolean

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node break
@unnumberedsec break
@cindex break

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Byte
@unnumberedsec Byte
@cindex Byte

@unnumberedsubsec Description

@samp{Byte} is an unsigned integer type which is one ``unit'' wide.
On most platforms one unit has 8 bits, therefore the type is named
``byte'' and usually has a range of @samp{0..255}.  (It is the same
as @ref{ByteCard}.)

@samp{Byte} in GNU Pascal is compatible to @samp{unsigned char}
in GNU C.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{Byte}.
(However see @ref{Subrange types}.)

The @samp{Byte} type appears in Borland Pascal and Delphi, too, where
it is an unsigned 8-bit integer type.

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node ByteBool
@unnumberedsec ByteBool
@cindex ByteBool

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node ByteCard
@unnumberedsec ByteCard
@cindex ByteCard

@unnumberedsubsec Description

@samp{ByteCard} is an unsigned integer type which is one ``unit'' wide.
On most platforms one unit has 8 bits, therefore the type is prefixed
``byte-'' and usually has a range of @samp{0..255}.

@samp{ByteCard} in GNU Pascal is compatible to @samp{unsigned char}
in GNU C.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{ByteCard}.
(However see @ref{Subrange types}.)

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node ByteInt
@unnumberedsec ByteInt
@cindex ByteInt

@unnumberedsubsec Description

@samp{ByteInt} is a signed integer type which is one ``unit'' wide.
On most platforms one unit has 8 bits, therefore the type is prefixed
``byte-'' and usually has a range of @samp{-128..127}.

@samp{ByteInt} in GNU Pascal is compatible to @samp{signed char}
in GNU C.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{ShortInt}.
(However see @ref{Subrange types}.)

@samp{ByteInt} in GNU Pascal corresponds to @ref{ShortInt} in Borland Pascal
and Delphi.

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node C
@unnumberedsec C
@cindex C

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node C_Language
@unnumberedsec C_Language
@cindex C_Language

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Card
@unnumberedsec Card
@cindex Card

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function Card ( S: @var{any set} ): Integer;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Cardinal
@unnumberedsec Cardinal
@cindex Cardinal

@unnumberedsubsec Description

@samp{Cardinal} is the ``natural'' unsigned integer type in GNU Pascal.
On most platforms it is 32 bits wide and thus has a range of
@samp{0..4294967295}.  Use it whenever you need a general-purpose
unsigned integer type and don't need to care about compatibility
to other Pascal dialects.

As an extension, GPC allows to use @samp{Cardinal} as a pseudo-schema
to produce types with a specified size in bits; for example

@smallexample
  Type
    Card16 = Cardinal ( 16 );
@end smallexample

defines an unsigned integer type with 16 bits.  The same mechanism
works for @samp{Integer} and @samp{Word}, too.

@samp{Cardinal} in GNU Pascal is compatible to @samp{unsigned int}
in GNU C.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{Cardinal}.
(However see @ref{Subrange types}.)

The @samp{Cardinal} type appears in Delphi, too, where it has
16 bits in version 1.0, 32 from version 2.0 on.

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node case
@unnumberedsec case
@cindex case

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Char
@unnumberedsec Char
@cindex Char

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node ChDir
@unnumberedsec ChDir
@cindex ChDir

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure ChDir ( Directory: String );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node chr
@unnumberedsec chr
@cindex chr

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function chr ( AsciiCode: Integer ): Char;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node close
@unnumberedsec close
@cindex close

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure Close ( Var F: @var{any file} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node cmplx
@unnumberedsec cmplx
@cindex cmplx

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function cmplx ( RealPart, ImaginaryPart: Real ): Complex;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Comp
@unnumberedsec Comp
@cindex Comp

@unnumberedsubsec Description

@samp{Comp} is a signed integer type which is longer than
@samp{Integer}.  On most platforms it is 64 bits wide and thus has
a range of @samp{-9223372036854775808..9223372036854775807}.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{Comp}.

Borland Pascal and Delphi also define @samp{Comp} as a 64-bit signed
integer type.  This compatibility is the reason why GPC supports @samp{Comp}.
In some contexts, the Borland compilers treat @samp{Comp} as a ``real''
type---this behaviour is not supported by GPC.


@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node Complex
@unnumberedsec Complex
@cindex Complex

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Concat
@unnumberedsec Concat
@cindex Concat

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function Concat ( S1, S2: String ): String;
@end smallexample
or
@smallexample
  Function Concat ( S1, S2, S3: String ): String;
@end smallexample
or
@smallexample
  ...
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node conjugate
@unnumberedsec conjugate
@cindex conjugate

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function conjugate ( z: Complex ): Complex;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Const
@unnumberedsec Const
@cindex Const

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Constructor
@unnumberedsec Constructor
@cindex Constructor

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node continue
@unnumberedsec continue
@cindex continue

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Copy
@unnumberedsec Copy
@cindex Copy

@unnumberedsubsec Syntax

@smallexample
  Function Copy ( S: String; FirstChar, Count: Integer ): String;
@end smallexample
or
@smallexample
  Function Copy ( S: String; FirstChar: Integer ): String;
@end smallexample

@unnumberedsubsec Description

@samp{Copy} returns a sub-string of @var{S} starting with the
character at position @var{FirstChar}.  If @var{Count} is given, such
many characters will be copied into the sub-string.  If @var{Count} is
omitted, the sub-string will will range to the end of @var{S}.

If @samp{Count} is too large for the sub-string to fit in @var{S}, the
result will be truncated at the end of @var{S}.  If @samp{FirstChar}
exceeds the length of @var{S}, the empty string will be returned.
(For a function which does not truncate but triggers a runtime error
instead, see @ref{SubStr}.)

Please note that GPC's strings may be longer than 255 characters.  If
you want to isolate the second half of a string @var{S} starting with
the third character, use @samp{Copy ( S, 3 )} instead of
@samp{Copy ( S, 3, 255 )}.

@unnumberedsubsec Standards

@samp{Copy} is defined in UCSD and Borland Pascal.  It does not appear
in ISO Pascal.  The possibility to omit the third parameter is a GPC
extension.

@unnumberedsubsec Example

@example
  Var
    S: String ( 42 );

  [...]

  S:= 'Hello';
  writeln ( Copy ( S, 2, 3 ) );   (* yields "ell" *)
  writeln ( Copy ( S, 3 ) );      (* yields "llo" *)
  writeln ( Copy ( S, 4, 7 ) );   (* yields "lo" *)
  writeln ( Copy ( S, 42 ) );     (* yields the empty string *)

@end example

@unnumberedsubsec See also

@ref{SubStr}, String slice access.


@c ----------------------------------------------------------------------------


@node cos
@unnumberedsec cos
@cindex cos

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function cos ( x: Real ): Real;
@end smallexample
or
@smallexample
  Function cos ( z: Complex ): Complex;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node CString
@unnumberedsec CString
@cindex CString

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node CString2String
@unnumberedsec CString2String
@cindex CString2String

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function CString2String ( S: CString ): String;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Date
@unnumberedsec Date
@cindex Date

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function Date ( T: TimeStamp ):
      packed array [ 1..@var{date length} ] of Char;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node dec
@unnumberedsec dec
@cindex dec

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure dec ( Var x: @var{ordinal type} );
@end smallexample
or
@smallexample
  Procedure dec ( Var x: @var{ordinal type}; amount: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node default
@unnumberedsec default
@cindex default

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node DefineSize
@unnumberedsec DefineSize
@cindex DefineSize

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure DefineSize ( Var F: @var{any file}; NewSize: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Delete
@unnumberedsec Delete
@cindex Delete

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure Delete ( Var S: String; FirstChar, Count: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Destructor
@unnumberedsec Destructor
@cindex Destructor

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Dispose
@unnumberedsec Dispose
@cindex Dispose

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Dispose ( PointerVar: Pointer );
@end smallexample
or
@smallexample
  Dispose ( PointerVar: Pointer; @var{tag field values} );
@end smallexample
or
@smallexample
  Dispose ( ObjectPointerVar: Pointer; @var{destructor call} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node div
@unnumberedsec div
@cindex div

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Operator div ( p, q: Integer ) = r: Integer;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node do
@unnumberedsec do
@cindex do

@unnumberedsubsec Description

The @samp{do} reserved word is used in combination with other Pascal
keywords in many ways. For description and examples see the relevant
reference sections:  @samp{for}, @samp{while}, @samp{with},
@samp{to begin}, @samp{to end}.

@unnumberedsubsec Standards

@samp{do} is defined in the ISO-7185 Standard Pascal and supported by all
known Pascal variants.

@unnumberedsubsec See also

@ref{for}, @ref{while}, @ref{with}, @ref{to begin}, @ref{to end}.


@c ----------------------------------------------------------------------------


@node Double
@unnumberedsec Double
@cindex Double

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Type
    Double = Real;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node downto
@unnumberedsec downto
@cindex downto

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node else
@unnumberedsec else
@cindex else

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node empty
@unnumberedsec empty
@cindex empty

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function empty ( Var F: @var{any file} ): Boolean;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node end
@unnumberedsec end
@cindex end

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node eof
@unnumberedsec eof
@cindex eof

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function eof ( Var F: @var{any file} ): Boolean;
@end smallexample
or
@smallexample
  Function eof: Boolean;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node eoln
@unnumberedsec eoln
@cindex eoln

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function eoln ( Var F: @var{any file} ): Boolean;
@end smallexample
or
@smallexample
  Function eoln: Boolean;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node EpsReal
@unnumberedsec EpsReal
@cindex EpsReal

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node eq
@unnumberedsec eq
@cindex eq

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function eq ( S1, S2: String ): Boolean;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node erase
@unnumberedsec erase
@cindex erase

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure erase ( Var F: @var{any file} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Exit
@unnumberedsec Exit
@cindex Exit

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node exp
@unnumberedsec exp
@cindex exp

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function exp ( x: Real ): Real;
@end smallexample
or
@smallexample
  Function exp ( z: Complex ): Complex;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Export
@unnumberedsec Export
@cindex Export

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node extend
@unnumberedsec extend
@cindex extend

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure extend ( Var F: @var{any file} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Extended
@unnumberedsec Extended
@cindex Extended

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Type
    Extended = LongReal;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node extern
@unnumberedsec extern
@cindex extern

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node external
@unnumberedsec external
@cindex external

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node false
@unnumberedsec false
@cindex false

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node far
@unnumberedsec far
@cindex far

@unnumberedsubsec Description

The @samp{far} directive can be appended to a procedure or function
heading but is ignored by GPC.  It is there for Borland compatibility,
only.  (Since the GNU compilers provide a flat memory model, the
distinction between @samp{near} and @samp{far} pointers is void.)

@unnumberedsubsec Standards

ISO Pascal does not define @samp{far}, Borland Pascal does.

@unnumberedsubsec Example

@cindex foo
@example
  Var
    p: Procedure;

  Procedure Foo; far;  (* `far' has no effect in GPC *)

  begin (* Foo *)
    [...]
  end (* Foo *);

  [...]

  p:= Foo;  (* Would also work without `far' in GPC. *)
@end example

@unnumberedsubsec See also

@ref{near}.


@c ----------------------------------------------------------------------------


@node FileMode
@unnumberedsec FileMode
@cindex FileMode

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Var
    FileMode: Integer;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node File
@unnumberedsec File
@cindex File

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node FilePos
@unnumberedsec FilePos
@cindex FilePos

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function FilePos ( Var F: @var{any file} ): Integer;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node FileSize
@unnumberedsec FileSize
@cindex FileSize

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function FileSize ( Var F: @var{any file} ): Integer;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node FillChar
@unnumberedsec FillChar
@cindex FillChar

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure FillChar ( Var Dest; Count: Integer; Value: Char );
@end smallexample
or
@smallexample
  Procedure FillChar ( Var Dest; Count: Integer; Value: Byte );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node flush
@unnumberedsec flush
@cindex flush

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure flush ( Var F: @var{any file} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node for
@unnumberedsec for
@cindex for

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  for @var{ordinal variable} := @var{initial value} to @var{final value} do
    @var{statement}
@end smallexample
or
@smallexample
  for @var{ordinal variable} := @var{initial value} downto @var{final value} do
    @var{statement}
@end smallexample
or
@smallexample
  for @var{ordinal variable} in @var{some set} do
    @var{statement}
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node forward
@unnumberedsec forward
@cindex forward

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node frac
@unnumberedsec frac
@cindex frac

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function frac ( x: Real ): Real;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node FreeMem
@unnumberedsec FreeMem
@cindex FreeMem

@unnumberedsubsec Syntax

@smallexample
  Procedure FreeMem ( Var p: Pointer; Size: Cardinal );
@end smallexample
or
@smallexample
  Procedure FreeMem ( Var p: Pointer );
@end smallexample

@unnumberedsubsec Description

Releases a chunk of memory previously allocated using @samp{GetMem}.
The parameter @var{Size} is optional, and its value is ignored.

Since Extended Pascal's schemata provide a cleaner way to implement dynamical
arrays and such, we recommend using @samp{GetMem} and @samp{FreeMem} only for
low-level applications or for interfacing with other languages.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{FreeMem}, Borland Pascal does and requires
two parameters.  @samp{FreeMem} with only one parameter is a GNU extension.

@unnumberedsubsec Example

@xref{GetMem}

@unnumberedsubsec See also

@ref{GetMem}, @ref{Schemata}, @ref{Dispose}, @ref{Mark}, @ref{Release}.


@c ----------------------------------------------------------------------------


@node Function
@unnumberedsec Function
@cindex Function

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node ge
@unnumberedsec ge
@cindex ge

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function ge ( S1, S2: String ): Boolean;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Get
@unnumberedsec Get
@cindex Get

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure Get ( Var F: @var{typed file} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node GetFile
@unnumberedsec GetFile
@cindex GetFile

@unnumberedsubsec Syntax

@smallexample
  Function GetFile ( F: @var{file type} ): Pointer;
@end smallexample

@unnumberedsubsec Description

GNU Pascal files internally contain a C @samp{FILE} descriptor.
@samp{GetFile} returns a pointer to this, so you can pass it to
external procedures or functions, perhaps written in C, that
cannot handle Pascal files.

@unnumberedsubsec Standards

@samp{GetFile} is a GNU extension.

@unnumberedsubsec Example

@example
  Program Hello;

  Procedure fputs ( S: CString; someFile: Pointer ); C;

  begin
    fputs ( 'Hello, world!'^J, GetFile ( Output ) );
  end.
@end example

@unnumberedsubsec See also

@ref{C}, @ref{CString}, @ref{Other languages}.


@c ----------------------------------------------------------------------------


@node GetMem
@unnumberedsec GetMem
@cindex GetMem

@unnumberedsubsec Syntax

@smallexample
  Procedure GetMem ( Var p: Pointeger; Size: Cardinal );
@end smallexample
or
@smallexample
  Function GetMem ( Size: Cardinal ): Pointer;
@end smallexample

@unnumberedsubsec Description

Allocates dynamical storage on the heap and returns a pointer to it in
@samp{p} or as the function result.

Since Extended Pascal's schemata provide a cleaner way to implement dynamical
arrays and such, we recommend using @samp{GetMem} and @samp{FreeMem} only for
low-level applications.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{GetMem}, Borland Pascal does, but only as a
procedure.  @samp{GetMem} as a function is a GNU extension.

@unnumberedsubsec Example

The Borland-comatibility Unit @samp{Graph} from the @file{BPcompat} package
supports a @samp{GetImage} and a @samp{PutImage} procedure which need a
variable of size @samp{ImageSize} as a buffer.  Since these are ``black box''
routines, the buffer can't reasonably be a schema providing a dynamical array.
Instead, we have to use @samp{GetMem} and @samp{FreeMem} for dynamical memory
allocation.

@example
  Program TestGetMem;

  uses
    Graph;

  Var
    Buffer: Pointer;
    Size: Cardinal;

  begin
    [...]
    Size:= ImageSize ( 10, 10, 60, 30 );
    Buffer:= GetMem ( Size );  (* or: GetMem ( Buffer, Size ); *)
    GetImage ( 10, 10, 60, 30, Buffer^ );
    [...]
    FreeMem ( Buffer );  (* or: FreeMem ( Buffer, Size ); *)
    [...]
  end.
@end example

@unnumberedsubsec See also

@ref{FreeMem}, @ref{New}, @ref{Schemata}.


@c ----------------------------------------------------------------------------


@node GetTimeStamp
@unnumberedsec GetTimeStamp
@cindex GetTimeStamp

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure GetTimeStamp ( Var T: TimeStamp );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node goto
@unnumberedsec goto
@cindex goto

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node gt
@unnumberedsec gt
@cindex gt

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function gt ( S1, S2: String ): Boolean;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Halt
@unnumberedsec Halt
@cindex Halt

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure Halt;
@end smallexample
or
@smallexample
  Procedure Halt ( ExitCode: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node high
@unnumberedsec high
@cindex high

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function high ( @var{ordinal type or variable} ): Integer;
@end smallexample
or
@smallexample
  Function high ( @var{array type or variable} ): Integer;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node if
@unnumberedsec if
@cindex if

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Im
@unnumberedsec Im
@cindex Im

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function Im ( z: Complex ): Real;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node import
@unnumberedsec import
@cindex import

@unnumberedsubsec Description

The reserved word @samp{import} in the @emph{import part} of a program makes
the program import an interface.  The syntax is

@cindex foo
@smallexample
  Program foo;

  import
    bar1;
    bar3 ( baz1 => glork1 ) in 'baz.pas';
    bar2 only ( baz2, baz3 => glork2 );

  [...]
@end smallexample

The @samp{in} above tells GPC to look for the @samp{Module} in the specified
file; otherwise the file name is derived from the name of the interface by
adding first @file{.p}, then @file{.pas}---which only works if the name of the
exported interface coincides with the file name.

The symbol @samp{=>} denotes import renaming:  The entity which is exported
under the name @samp{baz1} by the interface @samp{bar3} will be known under
the new name @samp{glork1} in the program.

The @samp{only} qualifier means that only the listed identifiers will be
imported from the interface.  Renaming works together with @samp{only}, too.

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

The interfaces needn't be exported by Extended Pascal Modules but may be
UCSD/Borland Pascal Units as well.

@unnumberedsubsec Standards

ISO-7185 Standard Pascal does not define @samp{import} and Modules in general.
These are defined in the ISO-10206 Extended Pascal standard.

GNU Pascal does not yet support @samp{qualified} import.

@unnumberedsubsec See also

@ref{Module}, @ref{Unit}, @ref{uses}.


@c ----------------------------------------------------------------------------


@node Implementation
@unnumberedsec Implementation
@cindex Implementation

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node in
@unnumberedsec in
@cindex in

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node inc
@unnumberedsec inc
@cindex inc

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure inc ( Var x: @var{ordinal type} );
@end smallexample
or
@smallexample
  Procedure inc ( Var x: @var{ordinal type}; amount: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Index
@unnumberedsec Index
@cindex Index

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node inherited
@unnumberedsec inherited
@cindex inherited

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node inline
@unnumberedsec inline
@cindex inline

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node InOutRes
@unnumberedsec InOutRes
@cindex InOutRes

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Var
    InOutRes: Integer;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node InOutResStr
@unnumberedsec InOutResStr
@cindex InOutResStr

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Var
    InOutResStr: CString;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Input
@unnumberedsec Input
@cindex Input

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Var
    Input: Text;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Insert
@unnumberedsec Insert
@cindex Insert

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure Insert ( Source: String; Var Dest: String; Position: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node int
@unnumberedsec int
@cindex int

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function int ( x: Real ): Real;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Integer
@unnumberedsec Integer
@cindex Integer

@unnumberedsubsec Description

@samp{Integer} is the ``natural'' signed integer type in GNU Pascal.
On most platforms it is 32 bits wide and thus has a range of
@samp{-2147483648..2147483647}.  Use it whenever you need a 
general-purpose signed integer type.

As an extension, GPC allows to use @samp{Integer} as a pseudo-schema
to produce types with a specified size in bits; for example

@smallexample
  Type
    Int16 = Integer ( 16 );
@end smallexample

defines an integer type with 16 bits.  The same mechanism works for
@samp{Cardinal} and @samp{Word}, too.

@samp{Integer} in GNU Pascal is compatible to @samp{int} in GNU C.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

In ISO Pascal, @samp{Integer} is the only built-in integer type.
(However see @ref{Subrange types}.)

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node Interface
@unnumberedsec Interface
@cindex Interface

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node IOresult
@unnumberedsec IOresult
@cindex IOresult

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function IOresult: Integer;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Label
@unnumberedsec Label
@cindex Label

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node LastPosition
@unnumberedsec LastPosition
@cindex LastPosition

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function LastPosition ( Var F: @var{typed file} ): Integer;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node le
@unnumberedsec le
@cindex le

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function le ( S1, S2: String ): Boolean;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node length
@unnumberedsec length
@cindex length

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function length ( S: String ): Integer;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node ln
@unnumberedsec ln
@cindex ln

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function ln ( x: Real ): Real;
@end smallexample
or
@smallexample
  Function ln ( z: Complex ): Complex;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node LoCase
@unnumberedsec LoCase
@cindex LoCase

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function LoCase ( Ch: Char ): Char;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node LongCard
@unnumberedsec LongCard
@cindex LongCard

@unnumberedsubsec Description

@samp{LongCard} is an unsigned integer type which is longer than
@samp{Cardinal}.  On most platforms it is 64 bits wide and thus has
a range of @samp{0..18446744073709551615}.

@samp{LongCard} in GNU Pascal is compatible to @samp{long long unsigned int}
in GNU C.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{LongCard}.

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node LongInt
@unnumberedsec LongInt
@cindex LongInt

@unnumberedsubsec Description

@samp{LongInt} is a signed integer type which is longer than
@samp{Integer}.  On most platforms it is 64 bits wide and thus has
a range of @samp{-9223372036854775808..9223372036854775807}.

@samp{LongInt} in GNU Pascal is compatible to @samp{long long int}
in GNU C.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{LongInt}.

Borland Pascal and Delphi also define @samp{LongInt}, but it
is a 32-bit signed integer type there (@ref{Integer} in GNU Pascal).
Both Borland languages define @ref{Comp} as a 64-bit signed integer
type which is also supported by GPC for compatibility.

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node LongestCard
@unnumberedsec LongestCard
@cindex LongestCard

@unnumberedsubsec Description

@samp{LongestCard} is GPC's longest-possible unsigned integer type.
Currently, this is the same as @ref{LongCard}.
On most platforms it is 64 bits wide and thus has
a range of @samp{0..18446744073709551615}.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{LongestCard}.

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node LongestInt
@unnumberedsec LongestInt
@cindex LongestInt

@unnumberedsubsec Description

@samp{LongestInt} is GPC's longest-possible signed integer type.
Currently, this is the same as @ref{LongInt}.
On most platforms it is 64 bits wide and thus has
a range of @samp{-9223372036854775808..9223372036854775807}.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{LongestInt}.

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node LongestReal
@unnumberedsec LongestReal
@cindex LongestReal

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node LongestWord
@unnumberedsec LongestWord
@cindex LongestWord

@unnumberedsubsec Description

@samp{LongestWord} is GPC's longest-possible unsigned integer type.
Currently, this is the same as @ref{LongWord}.
On most platforms it is 64 bits wide and thus has
a range of @samp{0..18446744073709551615}.  (It is the same as
@ref{LongestCard}.)

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{LongestWord}.

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node LongReal
@unnumberedsec LongReal
@cindex LongReal

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node LongWord
@unnumberedsec LongWord
@cindex LongWord

@unnumberedsubsec Description

@samp{LongWord} is an unsigned integer type which is larger than
@samp{Word}.  On most platforms it is 64 bits wide and thus has
a range of @samp{0..18446744073709551615}.  It is the same as
@ref{LongCard}.

@samp{LongWord} in GNU Pascal is compatible to @samp{long long unsigned int}
in GNU C.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{LongWord}.

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node low
@unnumberedsec low
@cindex low

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Syntax

@smallexample
  Function low ( @var{ordinal type or variable} ): Integer;
@end smallexample
or
@smallexample
  Function low ( @var{array type or variable} ): Integer;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node lt
@unnumberedsec lt
@cindex lt

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function lt ( S1, S2: String ): Boolean;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Mark
@unnumberedsec Mark
@cindex Mark

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure Mark ( Var P: Pointer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node max
@unnumberedsec max
@cindex max

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function max ( x1, x2: @var{ordinal or real type} ): @var{same type};
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node MaxChar
@unnumberedsec MaxChar
@cindex MaxChar

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node MaxInt
@unnumberedsec MaxInt
@cindex MaxInt

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node MaxReal
@unnumberedsec MaxReal
@cindex MaxReal

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node MedCard
@unnumberedsec MedCard
@cindex MedCard

@unnumberedsubsec Description

@samp{MedCard} is an unsigned integer type which is not smaller than
@samp{Cardinal}.  On most platforms it actually is the same as @samp{Cardinal}
and 32 bits wide and thus has a range of @samp{0..4294967295}.

@samp{MedCard} in GNU Pascal is compatible to @samp{long unsigned int}
in GNU C.  This compatibility is the reason why @samp{MedCard} exists.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{MedCard}.

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node MedInt
@unnumberedsec MedInt
@cindex MedInt

@unnumberedsubsec Description

@samp{MedInt} is a signed integer type which is not smaller than
@samp{Integer}.  On most platforms it actually is the same as @samp{Integer}
and 32 bits wide and thus has a range of @samp{-2147483648..2147483647}.

@samp{MedInt} in GNU Pascal is compatible to @samp{long int}
in GNU C.  This compatibility is the reason why @samp{MedInt} exists.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{MedInt}.

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node MedReal
@unnumberedsec MedReal
@cindex MedReal

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node MedWord
@unnumberedsec MedWord
@cindex MedWord

@unnumberedsubsec Description

@samp{MedWord} is an unsigned integer type which is not smaller than
@samp{Word}.  On most platforms it actually is the same as @samp{Word}
and 32 bits wide and thus has a range of @samp{0..4294967295}.  It is
the same as @ref{MedCard}.

@samp{MedWord} in GNU Pascal is compatible to @samp{long unsigned int}
in GNU C.  This compatibility is the reason why @samp{MedWord} exists.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{MedWord}.

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node min
@unnumberedsec min
@cindex min

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function min ( x1, x2: @var{ordinal or real type} ): @var{same type};
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node MinReal
@unnumberedsec MinReal
@cindex MinReal

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node MkDir
@unnumberedsec MkDir
@cindex MkDir

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure MkDir ( Directory: String );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node mod
@unnumberedsec mod
@cindex mod

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Operator mod ( p, q: Integer ) = r: Integer;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Module
@unnumberedsec Module
@cindex Module

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node move
@unnumberedsec move
@cindex move

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure move ( Const Source; Var Dest; Count: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node MoveLeft
@unnumberedsec MoveLeft
@cindex MoveLeft

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure MoveLeft ( Const Source; Var Dest; Count: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node MoveRight
@unnumberedsec MoveRight
@cindex MoveRight

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure MoveRight ( Const Source; Var Dest; Count: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node near
@unnumberedsec near
@cindex near

@unnumberedsubsec Description

The @samp{near} directive can be appended to a procedure or function
heading but is ignored by GPC.  It is there for Borland compatibility,
only.  (Since the GNU compilers provide a flat memory model, the
distinction between @samp{near} and @samp{near} pointers is void.)

@unnumberedsubsec Standards

ISO Pascal does not define @samp{near}, Borland Pascal does.

@unnumberedsubsec Example

@cindex foo
@example
  Var
    p: Procedure;

  Procedure Foo; near;  (* `near' has no effect in GPC *)

  begin (* Foo *)
    [...]
  end (* Foo *);

  [...]

  p:= Foo;  (* Works, despite the `near'. *)
@end example

@unnumberedsubsec See also

@ref{far}.


@c ----------------------------------------------------------------------------


@node ne
@unnumberedsec ne
@cindex ne

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function ne ( S1, S2: String ): Boolean;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node New
@unnumberedsec New
@cindex New

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure New ( Var P: @var{any pointer} );
@end smallexample
or
@smallexample
  Procedure New ( Var P: @var{pointer to a variant record}; @var{tag fields});
@end smallexample
or
@smallexample
  Procedure New ( Var P: @var{pointer to a schema}; @var{discriminants});
@end smallexample
or
@smallexample
  Procedure New ( Var P: @var{pointer to an object}; @var{constructor call});
@end smallexample
or
@smallexample
  Function New ( @var{any pointer type} ): @var{same type};
@end smallexample
or
@smallexample
  Function New ( @var{variant record pointer type};
                 @var{tag fields}): @var{same type};
@end smallexample
or
@smallexample
  Function New ( @var{schema pointer type};
                 @var{discriminants}): @var{same type};
@end smallexample
or
@smallexample
  Function New ( @var{object pointer type};
                 @var{constructor call}): @var{same type};
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node NewCString
@unnumberedsec NewCString
@cindex NewCString

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function NewCString ( Const S: String ): CString;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Nil
@unnumberedsec Nil
@cindex Nil

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node not
@unnumberedsec not
@cindex not

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Operator not ( b1, b2: Boolean ) = result: Boolean;
@end smallexample
or
@smallexample
  Operator not ( i1, i2: @var{integer type} ) = result: @var{integer type};
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node NULL
@unnumberedsec NULL
@cindex NULL

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Var NULL: Void absolute 0;
@end smallexample

@unnumberedsubsec Description

Variable at address @code{Nil}.

@unnumberedsubsec Standards

Delphi

@unnumberedsubsec Example

@unnumberedsubsec See also

@ref{Nil}.

@c ----------------------------------------------------------------------------


@node object
@unnumberedsec object
@cindex object

@unnumberedsubsec Description

The keyword @samp{object} is used to declare a new object type:

@cindex foo
@smallexample
  Type
    foo = object
      a: Integer;
      Constructor Init;
      Procedure bar ( x: Integer ); virtual;
    end (* foo *);
@end smallexample

(For a longer example, see @ref{OOP}.)

@unnumberedsubsec Standards

GNU Pascal follows the Borland Pascal 7.0 object model.

ISO Pascal does not support Object-orientated programming.  There is an ANSI
draft for an ``Object Pascal'' language which is not yet supported by GPC, but
planned.  The Delphi language, also called ``Object Pascal'' by Borland, is
currently not supported by GPC either.

@unnumberedsubsec See also

@ref{OOP},
@ref{record}.


@c ----------------------------------------------------------------------------


@node odd
@unnumberedsec odd
@cindex odd

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function odd ( i: Integer ): Boolean;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node of
@unnumberedsec of
@cindex of

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node only
@unnumberedsec only
@cindex only

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Operator
@unnumberedsec Operator
@cindex Operator

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node or
@unnumberedsec or
@cindex or

@unnumberedsubsec Syntax

@smallexample
  Operator or ( operand1, operand2: Boolean ) = result: Boolean;
@end smallexample
or
@smallexample
  Operator or ( operand1, operand2: @var{integer type} ) = result: @var{integer type};
@end smallexample
or
@smallexample
  Procedure or ( Var operand1: @var{integer type}; operand2: @var{integer type} );
@end smallexample

@unnumberedsubsec Description

In GNU Pascal, @samp{or} has three built-in meanings:

@enumerate

@item
Logical ``or'' between two @samp{Boolean}-type expressions.
The result of the operation is of @samp{Boolean} type.

By default, @samp{or} acts as a short-circuit operator in GPC:  If the first
operand is @samp{true}, the second operand is not evaluated because the result
is already known to be @samp{true}.  You can change this to complete
evaluation using the @samp{--no-short-circuit} command-line option or the
@samp{(*$B+*)} compiler directive.

@item
Bitwise ``or'' between two integer-type expressions.
The result is of the common integer type of both expressions.

@item
Use as a ``procedure'':  @samp{operand1} is ``or''ed bitwise with
@samp{operand2}; the result is stored in @samp{operand1}.

@end enumerate

@unnumberedsubsec Standards

The logical @samp{or} operator is defined in ISO-7185 Standard Pascal.

According to ISO, you cannot rely on @samp{or} being a short-circuit
operator.  On the other hand, GPC's default behaviour does @emph{not}
contradict the ISO standard.  (See @ref{or_else}.)  However, since it seems
to be a de-facto standard among ISO Pascal compilers to evaluate both operands
of @samp{or}, GPC switches to @samp{--no-short-circuit} mode if one of the
language dialect options selecting ISO Pascal, for instance
@samp{--extended-pascal}, is given.  Use @samp{--short-circuit} to override.

ISO Pascal does not define the bitwise @samp{or} operator;
Borland Pascal and Delphi do.

Use of @samp{or} as a ``procedure'' is a GNU extension.

@unnumberedsubsec Example

@example
  Var
    a, b, c: Integer;

  @dots{}

  if ( a = 0 ) or ( b = 0 ) then  (* logical `or' *)
    c:= 1
  else if a or b = 0 then  (* bitwise `or' *)
    c:= 2
  else
    or ( c, a );  (* same as `c:= c or a' *)
@end example

Note the difference between the logical @samp{or} and the bitwise
@samp{or}:  When @samp{a} is 2 and @samp{b} is 4, then @samp{a or b} is 6.
@strong{Beware:}  @samp{a or b = 0} happens to mean the same as
@samp{( a = 0 ) and ( b = 0 )}.  (Note the @samp{and}!)

Since bitwise @samp{or} has a higher priority than the @samp{=} operator,
parentheses are needed in @samp{if ( a = 0 ) or ( b = 0 )} because otherwise
@samp{0 or b} would be calculated first, and the remainder would cause a
parse error.

@unnumberedsubsec See also

@ref{and}, @ref{xor}, @ref{Operators}.


@c ----------------------------------------------------------------------------


@node or else
@unnumberedsec or else
@cindex or else

@unnumberedsubsec Description

@samp{or else} is an alias for the short-circuit logical operator
@samp{or_else}.

@unnumberedsubsec Standards

While @samp{or_else} is defined in ISO-10206 Extended Pascal,
@samp{or else} is a GNU Extension.

@unnumberedsubsec Example

@example
  Var
    a: Integer;

  [...]

  if ( a = 0 ) or else ( 100 div a > 42 ) then  (* This is safe. *)
    [...];
@end example

@unnumberedsubsec See also

@ref{or_else}, @ref{or}, @ref{and then}.


@c ----------------------------------------------------------------------------


@node or_else
@unnumberedsec or_else
@cindex or_else

@unnumberedsubsec Syntax

@smallexample
  Operator or_else ( operand1, operand2: Boolean ) = result: Boolean;
@end smallexample

@unnumberedsubsec Description

The @samp{or_else} short-circuit logical operator performs the same
operation as the logical operator @samp{or}.  But while the ISO
standard does not specify anything about the evaluation of the operands
of @samp{or}---they may be evaluated in any order, or not at
all---@samp{or_else} has a well-defined behaviour:  It evaluates the
first operand.  If the result is @samp{true}, @samp{or_else} returns
@samp{true} without evaluating the second operand.  If it is @samp{false},
the second operand is evaluated and returned.

Since the behaviour described above is the most effective way to implement
@samp{or}, GPC by default treats @samp{or} and @samp{or_else} exactly the
same.  If you want, for some reason, to have both operands of @samp{or}
evaluated completely, you can specify the @samp{--no-short-circuit}
command-line option, but this is not portable.  The portable way to have both
operands evaluated is to assign both to temporary variables and then use
@samp{or}---or @samp{or_else}, it does not matter.

@unnumberedsubsec Standards

ISO-7185 Standard Pascal does not define @samp{or_else};
ISO-10206 Extended Pascal does.

Some people think that the ISO standard requires both operands of @samp{or}
to be evaluated.  This is false.  What the ISO standard @emph{does} say is
that you cannot rely on a certain order of evaluation of the operands of
@samp{or}; in particular things like

@example
  Var
    a: Integer;

  [...]

  if ( a = 0 ) or ( 100 div a > 42 ) then
    [...];
@end example

@noindent
can crash according to ISO Pascal, although they cannot crash when compiled
with GNU Pascal running in default mode.

If you want to write portable and efficient code in ISO-10206 Extended Pascal,
@emph{always} use @samp{or_else}; @emph{never} use @samp{or}.

@unnumberedsubsec Example

@example
  Var
    a: Integer;

  [...]

  if ( a = 0 ) or_else ( 100 div a > 42 ) then  (* This is safe. *)
    [...];
@end example

@unnumberedsubsec See also

@ref{or else}, @ref{or}, @ref{and_then}.


@c ----------------------------------------------------------------------------


@node ord
@unnumberedsec ord
@cindex ord

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function ord ( Ch: Char ): Integer;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node others
@unnumberedsec others
@cindex others

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node otherwise
@unnumberedsec otherwise
@cindex otherwise

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Output
@unnumberedsec Output
@cindex Output

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Var
    Output: Text;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node pack
@unnumberedsec pack
@cindex pack

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@smallexample
  Procedure pack ( Source: @var{unpacked array};
                   FirstElement: @var{index type};
                   Var Dest: @var{packed array} );
@end smallexample

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node packed
@unnumberedsec packed
@cindex packed

@unnumberedsubsec Description

@samp{packed} is a reserved word.  According to ISO-7185 Standard Pascal
it can preceed @samp{array} and @samp{record} type definitions to indicate
that memory usage should be minimized for variables of this type, possibly
at the expense of loss of speed.

As a GNU extension, @samp{packed} can also be applied to @ref{Subrange types}.

@unnumberedsubsec Standards

The reserved word @samp{packed} is defined in ISO-7185 Standard Pascal.

According to ISO standard, only @emph{packed} arrays of char with lower
bound 1 qualify as strings of fixed length.  GNU Pascal neither requires
@samp{packed} nor the lower bound of 1 here.

@unnumberedsubsec Example

@example
  Type
    MonthInt = packed 1..12;  (* needs one byte   *)
    FastMonthInt = 1..12;     (* needs four bytes *)

    FixString10 = packed array [ 1..10 ] of Char;
    FoxyString10 = array [ 0..9 ] of Char;

    Flags = packed array [ 1..32 ] of Boolean;  (* needs four Bytes *)

    DateRec = packed record
      day: 1..31;            (* five bits *)
      month: MonthInt;       (* four bits *)
      year: Integer ( 15 );  (* 15 bits = -16384..16383 *)
    end (* DateRec *);

    Dates = array [ 1..1000 ] of DateRec;

  Var
    S: FixString10;
    T: FoxyString10;

  [...]

  S:= 'Hello!';   (* blank padded *)
  writeln ( S );

  T:= 'GNU Pascal';  (* GPC extension: this also works. *)
  writeln ( T );
@end example

@samp{DateRec} has 24 bits = 3 bytes in total; @samp{Dates} has 3000 bytes.

@unnumberedsubsec See also

@ref{pack},
@ref{unpack},
@ref{SizeOf},
@ref{AlignOf},
@ref{BitSizeOf}.


@c ----------------------------------------------------------------------------


@node page
@unnumberedsec page
@cindex page

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure Page ( Var F: Text );
@end smallexample
or
@smallexample
  Procedure Page;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node pAnsiChar
@unnumberedsec pAnsiChar
@cindex pAnsiChar

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Type
    pAnsiChar = ^AnsiChar;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node ParamCount
@unnumberedsec ParamCount
@cindex ParamCount

@unnumberedsubsec Syntax

@smallexample
  Function ParamCount: Integer;
@end smallexample

@unnumberedsubsec Description

@samp{ParamCount} returns the number of command-line arguments given to the
program.  @samp{ParamCount} returns 0 if no arguments have been given to
the program; the name of the program as an implicit argument is not counted.

@unnumberedsubsec Standards

@samp{ParamCount} is a Borland Pascal extension.

@unnumberedsubsec Example

@example
  Program Test;

  Var
    i: Integer;

  begin
    writeln ( 'You have invoked this program with ',
              ParamCount, ' arguments.' );
    writeln ( 'These are:' );
    for i:= 1 to ParamCount do
      writeln ( ParamStr ( i ) );
  end.
@end example

@unnumberedsubsec See also

@ref{ParamStr}.


@c ----------------------------------------------------------------------------


@node ParamStr
@unnumberedsec ParamStr
@cindex ParamStr

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function ParamStr ( ParmNumber: Integer ): String;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node pChar
@unnumberedsec pChar
@cindex pChar

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Type
    pChar = ^Char;
@end smallexample
or
@smallexample
  Type
    pChar = CString;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Pointer
@unnumberedsec Pointer
@cindex Pointer

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node polar
@unnumberedsec polar
@cindex polar

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function polar ( rho, phi: Real ): Complex;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node pos
@unnumberedsec pos
@cindex pos

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function pos ( SearchPattern, Source: String ): Integer;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Position
@unnumberedsec Position
@cindex Position

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function Position ( Var F: @var{typed file} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node pow
@unnumberedsec pow
@cindex pow

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Operator pow ( base: Real; exponent: Integer ) = power: Real;
@end smallexample
or
@smallexample
  Operator pow ( base: Complex; exponent: Integer ) = power: Complex;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node pred
@unnumberedsec pred
@cindex pred

@unnumberedsubsec Syntax

@smallexample
  Function pred ( i: @var{ordinal type} ): @var{ordinal type};
@end smallexample
or
@smallexample
  Function pred ( i: @var{ordinal type}; j: Integer ): @var{ordinal type};
@end smallexample

or, with extended syntax (@samp{--extended-syntax} or @samp{(*$X+*)}),

@smallexample
  Function pred ( p: @var{pointer type} ): @var{pointer type};
@end smallexample
or
@smallexample
  Function pred ( p: @var{pointer type}; j: Integer ): @var{pointer type};
@end smallexample

@unnumberedsubsec Description

Returns the predecessor of the @var{ordinal type} value @samp{i}, or, if the
second argument @samp{j} is given, its @samp{j}th predecessor.  For integer
values @samp{i}, this is @samp{i - 1} (or @samp{i - j}).  (No, @samp{pred}
does @emph{not} work faster than plain subtraction.  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 decremented by the size of the variable pointed to, or,
if @samp{j} is given, by @samp{j} times the size of the variable pointed to.
If @samp{p} points to an element of an array, the returned pointer will point
to the (@samp{j}th) previous element of the array.


@unnumberedsubsec Standards

The @samp{pred} function is defined in ISO-7185 Standard Pascal.  The optional
second parameter is defined in ISO-10206 Extended Pascal.  Application of
@samp{pred} to pointers is defined in Borland Pascal.  The combination of the
second argument with application to pointers is a GNU extension.

@unnumberedsubsec Example

@cindex foo
@example
  Program PredTest;

  Type
    Metasyntactical = ( foo, bar, baz );

  Var
    m: Metasyntactical;
    c: Char;
    a: array [ 1..7 ] of Integer;
    p: ^Integer;

  begin
    m:= pred ( bar );     (* foo *)
    c:= pred ( 'Z', 2 );  (* 'X' *)
    a [ 1 ]:= 42;
    a [ 4 ]:= pred ( a [ 1 ] );     (* 41 *)
    a [ 5 ]:= pred ( a [ 4 ], 3 );  (* 38 *)
    (*$X+*)
    p:= @@a [ 5 ];
    p:= pred ( p );     (* now points to `a [ 4 ]' *)
    p:= pred ( p, 3 );  (* now points to `a [ 1 ]' *)
  end.
@end example

@unnumberedsubsec See also

@ref{succ}, @ref{dec}, @ref{Pointer arithmetics}.


@c ----------------------------------------------------------------------------


@node Procedure
@unnumberedsec Procedure
@cindex Procedure

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Program
@unnumberedsec Program
@cindex Program

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node protected
@unnumberedsec protected
@cindex protected

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node PtrCard
@unnumberedsec PtrCard
@cindex PtrCard

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node PtrInt
@unnumberedsec PtrInt
@cindex PtrInt

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node PtrWord
@unnumberedsec PtrWord
@cindex PtrWord

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Put
@unnumberedsec Put
@cindex Put

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure Put ( Var F: @var{typed file} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Re
@unnumberedsec Re
@cindex Re

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function Re ( z: Complex ): Real;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node read
@unnumberedsec read
@cindex read

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure read ( Var F: @var{typed file}; @var{variable} );
@end smallexample
or
@smallexample
  Procedure read ( Var F: Text; @var{variables} );
@end smallexample
or
@smallexample
  Procedure read ( @var{variables} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node readln
@unnumberedsec readln
@cindex readln

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure readln ( Var F: Text; @var{variables} );
@end smallexample
or
@smallexample
  Procedure readln ( @var{variables} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node ReadStr
@unnumberedsec ReadStr
@cindex ReadStr

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure ReadStr ( Const S: String; @var{variables} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Real
@unnumberedsec Real
@cindex Real

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node record
@unnumberedsec record
@cindex record

@unnumberedsubsec Description

The reserved word @samp{record} starts the definition of a new record type.
The syntax is

@cindex foo
@smallexample
  foo = record
    @var{field declarations}
  end (* foo *);
@end smallexample

or, with a variant part,

@smallexample
  foo = record
    @var{field declarations}
    case bar: @var{variant type} of
      @var{selector}: ( @var{field declarations} );
      @var{selector}: ( @var{field declarations} );
      @dots{}
  end (* foo *);
@end smallexample

or, without a variant selector field,

@smallexample
  foo = record
    @var{field declarations}
    case @var{variant type} of
      @var{selector}: ( @var{field declarations} );
      @var{selector}: ( @var{field declarations} );
      @dots{}
  end (* foo *);
@end smallexample

Records can be @samp{packed} to save memory usage at the expense of speed.

The variants of a variant record share one location in memory (inside the
record) and thus can be used to emulate type casting without violating
ISO-7185 Standard Pascal.

@unnumberedsubsec Standards

The reserved word @samp{record} and record types are defined in
ISO-7185 Standard Pascal.

According to ISO Pascal, the variant type must be an identifier.
GNU Pascal, like UCSD and Borland Pascal, also allows a subrange here.

@unnumberedsubsec Example

@example
  Type
    fooPtr = ^foo;

    foo = record
      bar: Integer;
      nextFoo: fooPtr;
      case choice: 1..3 of
        1: ( a: Integer );   (* These three choices share *)
        2: ( b: Real );      (* one location in memory.   *)
        3: ( c: Char;
             d: Boolean );
    end (* foo *);

    smallFoo = packed record
      b: 0..3;
      a: Integer ( 5 );
      r: Boolean;
    end (* smallFoo *);   (* needs 1 byte *)

  Var
    f: foo;

  [...]

  f.b:= 3.14;
  writeln ( f.a );  (* yields some strange number which is part of the   *)
                    (* internal representation of the real number `f.b'. *)
@end example

@unnumberedsubsec See also

@ref{packed},
@ref{array},
@ref{object}.


@c ----------------------------------------------------------------------------


@node Release
@unnumberedsec Release
@cindex Release

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure Release ( P: Pointer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node rename
@unnumberedsec rename
@cindex rename

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure Rename ( Var F: @var{any file}; NewName: String );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node repeat
@unnumberedsec repeat
@cindex repeat

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node reset
@unnumberedsec reset
@cindex reset

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure reset ( Var F: @var{any file} );
@end smallexample
or
@smallexample
  Procedure reset ( Var F: @var{any file}; FileName: String );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node restricted
@unnumberedsec restricted
@cindex restricted

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Result
@unnumberedsec Result
@cindex Result

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node return
@unnumberedsec return
@cindex return

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node rewrite
@unnumberedsec rewrite
@cindex rewrite

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure rewrite ( Var F: @var{any file} );
@end smallexample
or
@smallexample
  Procedure rewrite ( Var F: @var{any file}; FileName: String );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node RmDir
@unnumberedsec RmDir
@cindex RmDir

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure RmDir ( Directory: String );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node round
@unnumberedsec round
@cindex round

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function round ( x: Real ): Integer;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node RunError
@unnumberedsec RunError
@cindex RunError

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure RunError ( ErrorCode: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Seek
@unnumberedsec Seek
@cindex Seek

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure Seek ( Var F: @var{typed file}; NewPosition: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node SeekRead
@unnumberedsec SeekRead
@cindex SeekRead

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure SeekRead ( Var F: @var{typed file}; NewPosition: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node SeekUpdate
@unnumberedsec SeekUpdate
@cindex SeekUpdate

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure SeekUpdate ( Var F: @var{typed file}; NewPosition: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node SeekWrite
@unnumberedsec SeekWrite
@cindex SeekWrite

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure SeekWrite ( Var F: @var{typed file}; NewPosition: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Self
@unnumberedsec Self
@cindex Self

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node set
@unnumberedsec set
@cindex set

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node SetLength
@unnumberedsec SetLength
@cindex SetLength

@unnumberedsubsec Syntax

@smallexample
  Procedure SetLength ( Var S: String; NewLength: Integer );
@end smallexample

@unnumberedsubsec Description

@samp{SetLength} explicitly assigns a new length @samp{NewLength} to the
string parameter @code{S}.  The contents of the string is @emph{not} changed;
if the operation increases the length of the string, the characters appended
at the end are @emph{undefined}.

If you want to use @samp{SetLength}, please enable ``extended syntax''
(@samp{--extended-syntax} or @samp{(*$X+*)}).

@unnumberedsubsec Standards

@samp{SetLength} is a Borland Delphi 2.0 extension.

@unnumberedsubsec Example

@example
Program TestSetLength;

(*$X+*)  (* Enable "dangerous" features *)

Var
  S: String ( 26 );

begin
  S:= 'Hello, world!';
  SetLength ( S, length ( 'Hello' ) );
  writeln ( S );                                     (* 'Hello' *)
  SetLength ( S, 26 );
  writeln ( S );               (* 'Hello, world!(%$@@§"!"§$§"$'  *)
                        (* undefined characters ^^^^^^^^^^^^^   *)

  SetLength ( S, 42 );  (* The overflow is *not* (yet) detected *)
  writeln ( S );        (* This might cause a runtime error.    *)
end.
@end example

@unnumberedsubsec See also

@ref{length}, @ref{String}, @ref{SetType}.


@c ----------------------------------------------------------------------------


@node SetType
@unnumberedsec SetType
@cindex SetType

@unnumberedsubsec Syntax

@smallexample
  Procedure SetType ( Var SomeObject; VMT: Pointer );
@end smallexample

@unnumberedsubsec Description

The procedure @samp{SetType} explicitly assigns a value to the implicit
VMT field of an object.  This is normally done implicitly when a constructor
is called.

You can use this to write a polymorphic I/O routine which reads an object from
a file.  In this case, you cannot reasonably use @samp{New} to allocate the
storage, but you @samp{GetMem} it and initialize the object manually using
@samp{SetType} before calling the constructor explicitly.

This is a dangerous feature which yields a warning unless @samp{(*$X+*)} is
given.

@unnumberedsubsec Standards

@samp{SetType} is a GNU extension.

@unnumberedsubsec Example

@example
  (*$X+*)

  Type
    BasePtr = ^BaseObj;

    BaseObj = object
      Constructor Load;
    end (* BaseObj *)

    [Successor objects ...]

  [...]

  Function GetObject = Result: BasePtr;

  Var
    Size: Cardinal;
    VMT: Pointer;

  begin (* GetObject *)
    [Read the size of the object from some file and store it in `Size'.]
    GetMem ( Result, Size );
    [Read some ID from some file and look up the `VMT' from some table.]
    SetType ( Result^, VMT );
    (* Now the object is ready, and the constructor can be called. *)
    [Look up the correct constructor from some table and call it.]
  end (* GetObject *);
@end example

@unnumberedsubsec See also

@ref{TypeOf}, @ref{OOP}.


@c ----------------------------------------------------------------------------


@node ShortCard
@unnumberedsec ShortCard
@cindex ShortCard

@unnumberedsubsec Description

@samp{ShortCard} is an unsigned integer type which is not larger than
@samp{Cardinal}.  On most platforms it is 16 bits wide and thus has a
range of @samp{0..65535}.

@samp{ShortCard} in GNU Pascal is compatible to @samp{short unsigned int}
in GNU C.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{ShortCard}.
(However see @ref{Subrange types}.)

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node ShortInt
@unnumberedsec ShortInt
@cindex ShortInt

@unnumberedsubsec Description

@samp{ShortInt} is a signed integer type which is not larger than
@samp{Integer}.  On most platforms it is 16 bits wide and thus has a
range of @samp{-32768..32767}.

@samp{ShortInt} in GNU Pascal is compatible to @samp{short int}
in GNU C.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{ShortInt}.
(However see @ref{Subrange types}.)

@samp{ShortInt} in GNU Pascal corresponds to @samp{Integer} in Borland Pascal
and Delphi 1.0.  Both Borland languages also define @samp{ShortInt}, but it
is an 8-bit signed integer type there (@samp{ByteInt} in GNU Pascal).

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node ShortReal
@unnumberedsec ShortReal
@cindex ShortReal

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node ShortWord
@unnumberedsec ShortWord
@cindex ShortWord

@unnumberedsubsec Description

@samp{ShortWord} is an unsigned integer type which is not larger than
@samp{Word}.  On most platforms it is 16 bits wide and thus has a range of
of @samp{0..65535}.  It is the same as @ref{ShortCard}.

@samp{ShortWord} in GNU Pascal is compatible to @samp{short unsigned int}
in GNU C.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{ShortWord}.
(However see @ref{Subrange types}.)

@samp{ShortWord} in GNU Pascal essentially corresponds to @samp{Word} in
Borland Pascal and Delphi where it is a 16-bit unsigned integer type.

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node Single
@unnumberedsec Single
@cindex Single

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Type
    Single = ShortReal;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node shl
@unnumberedsec shl
@cindex shl

@unnumberedsubsec Syntax

@smallexample
  Operator shl ( operand1, operand2: @var{integer type} ) = result: @var{integer type};
@end smallexample
or
@smallexample
  Procedure shl ( Var operand1: @var{integer type}; operand2: @var{integer type} );
@end smallexample

@unnumberedsubsec Description

In GNU Pascal, @samp{shl} has two built-in meanings:

@enumerate

@item
Bitwise shift left of an integer-type expression by another integer value.
The result is of the type of the first operand.

@item
Use as a ``procedure'':  @samp{operand1} is shifted left by
@samp{operand2}; the result is stored in @samp{operand1}.

@end enumerate

@unnumberedsubsec Standards

ISO Pascal does not define the @samp{shl} operator;
Borland Pascal and Delphi do.

Use of @samp{shl} as a ``procedure'' is a GNU extension.

@unnumberedsubsec Example

@example
  Var
    a: Integer;

  @dots{}

  a:= 1 shl 7;  (* yields 128 = 2 pow 7 *)
  shl ( a, 4 );  (* same as `a:= a shl 4' *)
@end example

@unnumberedsubsec See also

@ref{shr}, @ref{Operators}.



@c ----------------------------------------------------------------------------


@node shr
@unnumberedsec shr
@cindex shr

@unnumberedsubsec Syntax

@smallexample
  Operator shr ( operand1, operand2: @var{integer type} ) = result: @var{integer type};
@end smallexample
or
@smallexample
  Procedure shr ( Var operand1: @var{integer type}; operand2: @var{integer type} );
@end smallexample

@unnumberedsubsec Description

In GNU Pascal, @samp{shr} has two built-in meanings:

@enumerate

@item
Bitwise shift right of an integer-type expression by another integer value.
The result is of the type of the first operand.

@item
Use as a ``procedure'':  @samp{operand1} is shifted right by
@samp{operand2}; the result is stored in @samp{operand1}.

@end enumerate

@unnumberedsubsec Standards

ISO Pascal does not define the bitwise @samp{shr} operator;
Borland Pascal and Delphi do.

Unlike the Borland compilers, GNU Pascal cares about the signedness
of the first operand:  If a signed integer with a negative value is
shifted right, ``one'' bits are filled in from the left.

Use of @samp{shr} as a ``procedure'' is a GNU extension.

@unnumberedsubsec Example

@example
  Var
    a: Integer;

  @dots{}

  a:= 1024 shr 4;  (* yields 64 *)
  a:= -127 shr 4;  (* yields -7 *)
  shr ( a, 2 );  (* same as `a:= a shr 2' *)
@end example

@unnumberedsubsec See also

@ref{shl}, @ref{Operators}.



@c ----------------------------------------------------------------------------


@node sin
@unnumberedsec sin
@cindex sin

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function sin ( x: Real ): Real;
@end smallexample
or
@smallexample
  Function sin ( z: Complex ): Complex;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node SizeOf
@unnumberedsec SizeOf
@cindex SizeOf

@unnumberedsubsec Syntax

@smallexample
  Function SizeOf ( Var x ): Integer;
@end smallexample

@unnumberedsubsec Description

Returns the size of a type or variable in bytes.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{SizeOf}; UCSD and Borland Pascal do.

@unnumberedsubsec Example

@example
  Var
    a: Integer;
    b: array [ 1..8 ] of Char;

  @dots{}

  writeln ( SizeOf ( a ) );  (* Size of an `Integer'; usually 4 bytes. *)
  writeln ( SizeOf ( b ) );  (* Size of eight `Char's; usually 8 bytes. *)
@end example

@unnumberedsubsec See also

@ref{BitSizeOf}, @ref{AlignOf}, @ref{TypeOf}.


@c ----------------------------------------------------------------------------


@node SmallInt
@unnumberedsec SmallInt
@cindex SmallInt

@unnumberedsubsec Description

@samp{SmallInt} is a signed integer type which is not larger than
@samp{Integer}.  On most platforms it is 16 bits wide and thus has a
range of @samp{-32768..32767}.  It is the same as @samp{ShortInt}
(see @ref{ShortInt}).

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{SmallInt}.
(However see @ref{Subrange types}.)

@samp{SmallInt} also appears in Delphi 2.0.  This compatibility is the reason
why GPC supports the synonym @samp{SmallInt} for @samp{ShortInt}.

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node sqr
@unnumberedsec sqr
@cindex sqr

@unnumberedsubsec Syntax

@smallexample
  Function sqr ( i: @var{integer type} ): @var{integer type};
@end smallexample
or
@smallexample
  Function sqr ( x: @var{real type} ): @var{real type};
@end smallexample
or
@smallexample
  Function sqr ( z: @var{complex type} ): @var{complex type};
@end smallexample

@unnumberedsubsec Description

Returns the square of the argument:

@smallexample
  Function sqr ( x: @var{some type} ): @var{some type};

  begin (* sqr *)
    sqr:= x * x;  (* or: x pow 2 *)
  end (* sqr *);
@end smallexample

@unnumberedsubsec Standards

The function @samp{sqr} is defined in ISO-7185 Standard Pascal;
its application to complex values is defined in ISO-10206 Extended Pascal.

@unnumberedsubsec Example

@smallexample
  Program TestSqr;

  Var
    i: Complex;

  begin
    i:= cmplx ( 0, 1 );
    writeln ( Re ( sqr ( i ) : 0 : 3 );
    (* yields -1.000 *)
  end.
@end smallexample

@unnumberedsubsec See also

@ref{pow}, @ref{sqrt}, @ref{abs}, @ref{Operators}.


@c ----------------------------------------------------------------------------


@node sqrt
@unnumberedsec sqrt
@cindex sqrt

@unnumberedsubsec Syntax

@smallexample
  Function sqrt ( x: @var{real type} ): @var{real type};
@end smallexample
or
@smallexample
  Function sqrt ( z: @var{complex type} ): @var{complex type};
@end smallexample

@unnumberedsubsec Description

Returns the positive square root of the argument.

For real arguments, it is an error if the argument is negative.

For complex arguments, @samp{sqrt} returns the principal value of the root of
the argument, i.e.@: the root with positive real part, or, if the real part
is zero, that one with positive imaginary part.

@unnumberedsubsec Standards

The function @samp{sqrt} is defined in ISO-7185 Standard Pascal;
its application to complex values is defined in ISO-10206 Extended Pascal.

@unnumberedsubsec Example

@smallexample
  Program TestSqrt;

  Var
    m1: Complex;

  begin
    m1:= cmplx ( -1, 0 );  (* -1 *)
    writeln ( Re ( sqrt ( m1 ) ) : 6 : 3, Im ( sqrt ( m1 ) ) : 6 : 3 );
    (* yields 1.000 -1.000, i.e. the imaginary unit, i *)
  end.
@end smallexample

@unnumberedsubsec See also

@ref{pow}, @ref{sqr}, @ref{Operators}.


@c ----------------------------------------------------------------------------


@node StandardError
@unnumberedsec StandardError
@cindex StandardError

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node StandardInput
@unnumberedsec StandardInput
@cindex StandardInput

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node StandardOutput
@unnumberedsec StandardOutput
@cindex StandardOutput

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node static
@unnumberedsec static
@cindex static

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node StdErr
@unnumberedsec StdErr
@cindex StdErr

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Var
    StdErr: Text;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Str
@unnumberedsec Str
@cindex Str

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure Str ( x: @var{integer or real}; Var Dest: String );
@end smallexample
or
@smallexample
  Procedure Str ( x: @var{integer or real} : @var{field width}; Var Dest: String );
@end smallexample
or
@smallexample
  Procedure Str ( x: Real : @var{field width} : @var{precision}; Var Dest: String );
@end smallexample
or
@smallexample
  Procedure Str ( @var{repeated constructs as described above}; Var Dest: String );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node StrPCopy
@unnumberedsec StrPCopy
@cindex StrPCopy

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function StrPCopy ( Dest: CString; Const Source: String ): CString;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node String
@unnumberedsec String
@cindex String

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node String2CString
@unnumberedsec String2CString
@cindex String2CString

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function String2CString ( Const S: String ): CString;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node SubStr
@unnumberedsec SubStr
@cindex SubStr

@unnumberedsubsec Syntax

@smallexample
  Function SubStr ( S: String; FirstChar: Integer ): String;
@end smallexample
or
@smallexample
  Function SubStr ( S: String; FirstChar, Count: Integer ): String;
@end smallexample

@unnumberedsubsec Description

@samp{SubStr} returns a sub-string of @var{S} starting with the
character at position @var{FirstChar}.  If @var{Count} is given, such
many characters will be copied into the sub-string.  If @var{Count} is
omitted, the sub-string will will range to the end of @var{S}.

If @samp{Count} is too large for the sub-string to fit in @var{S} or if
@samp{FirstChar} exceeds the length of @var{S}, @samp{SubStr} triggers a
runtime error.  (For a function returning the empty string instead, see
@ref{Copy}.)

@unnumberedsubsec Standards

@samp{SubStr} is defined in ISO 10206 Extended Pascal and does not
appear in Standard Pascal.

@unnumberedsubsec Example

@example
  Var
    S: String ( 42 );

  [...]

  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 example

@unnumberedsubsec See also

@ref{Copy}, String slice access.


@c ----------------------------------------------------------------------------


@node succ
@unnumberedsec succ
@cindex succ

@unnumberedsubsec Syntax

@smallexample
  Function succ ( i: @var{ordinal type} ): @var{ordinal type};
@end smallexample
or
@smallexample
  Function succ ( i: @var{ordinal type}; j: Integer ): @var{ordinal type};
@end smallexample

or, with extended syntax (@samp{--extended-syntax} or @samp{(*$X+*)}),

@smallexample
  Function succ ( p: @var{pointer type} ): @var{pointer type};
@end smallexample
or
@smallexample
  Function succ ( p: @var{pointer type}; j: Integer ): @var{pointer type};
@end smallexample

@unnumberedsubsec Description

Returns the successor of the @var{ordinal type} value @samp{i}, or, if the
second argument @samp{j} is given, its @samp{j}th successor.  For integer
values @samp{i}, this is @samp{i + 1} (or @samp{i + j}).  (No, @samp{succ}
does @emph{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 @samp{j} is given, by @samp{j} times the size of the variable pointed to.
If @samp{p} points to an element of an array, the returned pointer will point
to the (@samp{j}th) next element of the array.

@unnumberedsubsec Standards

The @samp{succ} function is defined in ISO-7185 Standard Pascal.  The optional
second parameter is defined in ISO-10206 Extended Pascal.  Application of
@samp{succ} to pointers is defined in Borland Pascal.  The combination of the
second argument with application to pointers is a GNU extension.

@unnumberedsubsec Example

@cindex foo
@example
  Program SuccTest;

  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 );     (* now points to `a [ 2 ]' *)
    p:= succ ( p, 3 );  (* now points to `a [ 5 ]' *)
  end.
@end example

@unnumberedsubsec See also

@ref{pred}, @ref{inc}, @ref{Pointer arithmetics}.


@c ----------------------------------------------------------------------------


@node Text
@unnumberedsec Text
@cindex Text

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node then
@unnumberedsec then
@cindex then

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Time
@unnumberedsec Time
@cindex Time

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function Time ( T: TimeStamp ):
      packed array [ 1..@var{time length} ] of Char;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node TimeStamp
@unnumberedsec TimeStamp
@cindex TimeStamp

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Type
    TimeStamp = record
      DateValid, TimeValid: Boolean;
      Year: Integer;
      Month: 1..12;
      Day: 1..31;
      Hour: 0..23;
      Minute, Second: 0..59;
      MicroSecond: Integer;
    end (* TimeStamp *);
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node to
@unnumberedsec to
@cindex to

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node to begin
@unnumberedsec to begin
@cindex to begin

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node to end
@unnumberedsec to end
@cindex to end

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Trim
@unnumberedsec Trim
@cindex Trim

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function Trim ( S: String ): String;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node true
@unnumberedsec true
@cindex true

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node trunc
@unnumberedsec trunc
@cindex trunc

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function trunc ( x: Real ): Integer;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Truncate
@unnumberedsec Truncate
@cindex Truncate

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure Truncate ( Var F: @var{any file} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Type
@unnumberedsec Type
@cindex Type

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node TypeOf
@unnumberedsec TypeOf
@cindex TypeOf

@unnumberedsubsec Syntax

@smallexample
  Function TypeOf ( Var x ): Pointer;
@end smallexample

@unnumberedsubsec Description

Returns a pointer to the VMT of an @emph{object} type or variable.
This pointer can be used to identify the type of an object.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{TypeOf}, Borland Pascal does.

@unnumberedsubsec Example

@cindex foo
@example
  Type
    fooPtr = ^foo;
    barPtr = ^bar;

    foo = object        (* Has a VMT, though it doesn't *)
      x: Integer;       (* contain virtual methods.     *)
      Constructor Init;
    end (* foo *);

    bar = object ( foo )
      y: Integer;
    end (* bar *);

  Var
    MyFoo: fooPtr;

  [...]

  MyFoo:= New ( barPtr, Init );

  if TypeOf ( MyFoo^ ) = TypeOf ( bar ) then  (* true *)
    writeln ( 'OK' );
@end example

@unnumberedsubsec See also

@ref{BitSizeOf}, @ref{AlignOf}, @ref{TypeOf}, @ref{SetType}, @ref{OOP}.


@c ----------------------------------------------------------------------------


@node UnBind
@unnumberedsec UnBind
@cindex UnBind

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure UnBind ( Var F: @var{any file} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Unit
@unnumberedsec Unit
@cindex Unit

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node unpack
@unnumberedsec unpack
@cindex unpack

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure unpack ( Source: @var{packed array};
                     Var Dest: @var{unpacked array};
                     FirstElement: @var{index type} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node until
@unnumberedsec until
@cindex until

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node UpCase
@unnumberedsec UpCase
@cindex UpCase

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Function UpCase ( Ch: Char ): Char;
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node update
@unnumberedsec update
@cindex update

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure update ( Var F: @var{any file} );
@end smallexample
or
@smallexample
  Procedure update ( Var F: @var{any file}; FileName: String );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node uses
@unnumberedsec uses
@cindex uses

@unnumberedsubsec Description

The reserved word @samp{uses} in the @emph{import part} of a program makes
the program import an interface.  The syntax is

@cindex foo
@smallexample
  Program foo;

  uses
    bar1,
    bar2 in 'baz.pas',
    bar3;

  [...]
@end smallexample

or, in a Unit,

@smallexample
  Unit Bar3;

  Interface

  uses
    bar1,
    bar2 in 'baz.pas';

  [...]
@end smallexample

The @samp{in} above tells GPC to look for the @samp{Unit} in the specified
file; otherwise the file name is derived from the name of the interface by
adding first @file{.p}, then @file{.pas}.

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

In a Unit, there is only one import part in the interface part; GPC currently
does not support a second import part 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.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{uses} and Units in general.  UCSD and Borland
Pascal do, but without the @samp{in} extension.  Delphi supports @samp{uses}
like described above.

@unnumberedsubsec See also

@ref{Unit}, @ref{Module}, @ref{import}.


@c ----------------------------------------------------------------------------


@node Val
@unnumberedsec Val
@cindex Val

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure Val ( Const Source: String; Var x: @var{integer or real} );
@end smallexample
or
@smallexample
  Procedure Val ( Const Source: String; Var x: @var{integer or real};
                  Var ErrorCode: Integer );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node value
@unnumberedsec value
@cindex value

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Var
@unnumberedsec Var
@cindex Var

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node virtual
@unnumberedsec virtual
@cindex virtual

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Void
@unnumberedsec Void
@cindex Void

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node while
@unnumberedsec while
@cindex while

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node with
@unnumberedsec with
@cindex with

(Under construction.)

@unnumberedsubsec Syntax

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node Word
@unnumberedsec Word
@cindex Word

@unnumberedsubsec Description

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

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

@smallexample
  Type
    Word16 = Cardinal ( 16 );
@end smallexample

defines an unsigned integer type with 16 bits.  The same mechanism
works for @samp{Cardinal} and @samp{Integer}, too.

@samp{Word} in GNU Pascal is compatible to @samp{unsigned int}
in GNU C.

There are lots of other integer types in GPC, see @ref{Integer types}.

@unnumberedsubsec Standards

ISO Pascal does not define @samp{Cardinal}.
(However see @ref{Subrange types}.)

The @samp{Word} type appears in Borland Pascal and Delphi, too, where
it is a 16-bit unsigned integer type.

@unnumberedsubsec See also

@ref{Integer types},
@ref{Subrange types}.


@c ----------------------------------------------------------------------------


@node write
@unnumberedsec write
@cindex write

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure write ( Var F: @var{typed file}; @var{variable} );
@end smallexample
or
@smallexample
  Procedure write ( Var F: Text; @var{values and format specifications} );
@end smallexample
or
@smallexample
  Procedure write ( @var{values and format specifications} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node writeln
@unnumberedsec writeln
@cindex writeln

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure writeln ( Var F: Text; @var{values and format specifications} );
@end smallexample
or
@smallexample
  Procedure writeln ( @var{values and format specifications} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node WriteStr
@unnumberedsec WriteStr
@cindex WriteStr

(Under construction.)

@unnumberedsubsec Syntax

@smallexample
  Procedure WriteStr ( Var Dest: String; @var{values and format specifications} );
@end smallexample

@unnumberedsubsec Description

@unnumberedsubsec Standards

@unnumberedsubsec Example

@unnumberedsubsec See also


@c ----------------------------------------------------------------------------


@node xor
@unnumberedsec xor
@cindex xor

@unnumberedsubsec Syntax

@smallexample
  Operator xor ( operand1, operand2: Boolean ) = result: Boolean;
@end smallexample
or
@smallexample
  Operator xor ( operand1, operand2: @var{integer type} ) = result: @var{integer type};
@end smallexample
or
@smallexample
  Procedure xor ( Var operand1: @var{integer type}; operand2: @var{integer type} );
@end smallexample

@unnumberedsubsec Description

In GNU Pascal, @samp{xor} has three built-in meanings:

@enumerate

@cindex foo
@item
Logical ``exclusive or'' between two @samp{Boolean}-type expressions.
The result of the operation is of @samp{Boolean} type.  (Logical @samp{foo xor
bar} in fact has the same effect as @samp{foo <> bar}.)

@item
Bitwise ``exclusive or'' between two integer-type expressions.
The result is of the common integer type of both expressions.

@item
Use as a ``procedure'':  @samp{operand1} is ``xor''ed bitwise with
@samp{operand2}; the result is stored in @samp{operand1}.

@end enumerate

@unnumberedsubsec Standards

ISO Pascal does not define the @samp{xor} operator; 
Borland Pascal and Delphi do.

Use of @samp{xor} as a ``procedure'' is a GNU extension.

@unnumberedsubsec Example

@example
  Var
    a, b, c: Integer;

  @dots{}

  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': `a' must be the bitwise *)
    c:= 2                   (* complement of `b' to fullfill this     *)
  else
    xor ( c, a );  (* same as `c:= c xor a' *)
@end example

@unnumberedsubsec See also

@ref{and}, @ref{or}, @ref{Operators}.


@c ============================================================================


@tex
%
% Restore previous definitions.
%
\global\let\unnumberedsec\unnumberedsecsave
\global\let\unnumberedsubseczzz\unnumberedsubseczzzsave
@end tex

