•  Back 
  •  Main 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The GFA-Basic Compendium
Author      : GFA Systemtechnik GmbH
Version     : GFABasic.HYP v2.98 (12/31/2023)
Subject     : Documentation/Programming
Nodes       : 899
Index Size  : 28056
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Document not found
@help       : Help
@options    : +g -i -s +z
@width      : 75
@hostname   : STRNGSRV
@hostname   : CAB     
@hostname   : HIGHWIRE
@hostname   : THING   
View Ref-FilePRED(i)
SUCC(i)

i: iexp

PRED() and SUCC() determine the next higher or next lower number.

PRED() returns the next lower number than the argument. So PRED() returns the
PREDecessor of a numerical expression. Note that this instruction operates on
integer expressions, so any decimal places are ignored. This gives rise to the
effect that, for instance, PRED(2.1) returns the result of 1, and not 2.

SUCC() returns the next higher number than the argument. So SUCC() returns the
SUCCessor of a numerical expression. Note that this instruction operates on
integer expressions, so any decimal places are ignored.

This function will also operate on string expressions, see the section on
'String Manipulation' (PRED() and SUCC()).

Example:

    i%=6
    j&=PRED(i%)
    PRINT j%,SUCC(2),PRED(3*i%)

--> On the screen, the numbers 5, 3, and 17 appear.