HP Pascal/iX Reference Manual (31502-90022)
Table Of Contents
- Top of Document
- Preface
- Chapter 1 Introduction
- Chapter 2 Language Elements
- Chapter 3 Data Types
- Chapter 4 Expressions
- Chapter 5 The Declaration Section
- Chapter 6 Statements
- Chapter 7 Program Structure
- Chapter 8 Procedures and Functions
- Chapter 9 Standard Routines
- Chapter 10 Input and Output
- Chapter 11 System Programming Extensions
- Chapter 12 Compiler Options
9- 32
Description
The pred function returns the value whose ordinal number is one less than
the ordinal number of the argument. The type of the result is identical
to the type of the argument. pred(
x
) must exist.
Example
Input Result
pred(ord_var) depends on the value of ord_var
pred(1) 0
pred(-5) -6
pred('B') 'A'
pred(true) false
pred(false) {error}
succ
succ
(x)
Argument
x
Any ordinal expression.
Description
The succ function returns the value whose ordinal number is one greater
than the ordinal number of the argument. The type of the result is
identical with the type of the argument. It is an error if succ
(x)
does
not exist.
Example
Input Result
succ(ord('b')) 99
succ(1) 2
succ(-5) -4
succ('a') 'b'
succ(false) true
succ(true) { error }