[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Succ                     Returns the Successor of any Ordinal

 Succ(Oval : <ordtype>) : <ordtype>;

    Returns the succeeding value of OVal. The result is not defined if
    OVal is the last possible value of <ordtype>. If OVal is an Integer,
    Succ(OVal) = OVal + 1.

            OVal    An ordinal value (constant, variable, function call,
                    or expression).

       <ordtype>    Any ordinal type: Integer, Char, Boolean, or
                    enumerated data type

         Limits:    If range checking is enabled {$R+} and OVal is the
                    last value in <ordtype>, runtime error 145 ($91)
                    occurs. If {$R-}, Succ(OVal) returns a value equal to
                    Ord(OVal)+1. SPECIAL CASE: If OVal is of type Integer
                    and is equal to MaxInt (32767), Succ(OVal) returns -
                    32768 regardless of range checking.Also if <ordtype>
                    is one byte in size and Ord(Oval) = 255,
                    Ord(Succ(Oval)) = 0.

  -------------------------------- Example ---------------------------------

           Ch   := Succ('B');       { Ch = 'C' }
           Flag := Succ(False);     { Flag = True }
           I    := Succ(42);        { I = 43 }

See Also: Pred Ord Retype Chr
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson