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- 29
Example
Input Result
hex(strng) depends on the value of strng
hex('FF') 255
-hex('FF') -255
NOTE If a particular implementation uses 32-bit 2's complement notation,
the following example also works:
hex('FFFFFF01') = -255
octal
Usage
octal
(s)
Argument
s
Any string or PAC expression whose range is implementation
dependent.
Description
The octal function converts a string or PAC expression that is
interpreted as an
octal
value to an integer. Leading and trailing blanks
in the argument are ignored. It is an error if any other character is
not a legal octal digit; for example, 0..7.
Example
Input Result
octal(strng) depends on the value of strng
octal('77') 63
-octal('77') -63
NOTE If your particular implementation uses 32-bit 2's complement
notation, the following example also works:
octal('37777777701') -63
Transfer Functions
Round and trunc are the
transfer functions
found in HP Pascal. These
functions are described on the next two pages.
round
Usage
round
(x)
Argument
x
Any real or longreal expression.