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- 19
baddress(p^)
baddress(p^.f3)
baddress(a)
baddress(a[4])
baddress(pac)
baddress(pac[2]) { Legal since component type is char. }
baddress(pab)
baddress(pab[2]) { Error. }
cmpbytes
Usage
cmpbytes (
s1
,
s2
,
l
)
Parameters
s1
A PAC or string variable that contains a byte string to
compare.
s2
A PAC or string variable that contains a byte string to
compare.
l
A shortint or bit16 expression that indicates the number of
bytes to be compared.
Result
A shortint indicating the result of the comparison:
0 :
s1
is less than
s2
.
1 :
s1
is greater than
s2
.
2 :
s1
is equal to
s2
.
Description
The function cmpbytes compares the
s1
and
s2
byte strings for
l
bytes.
The result is a shortint value indicating that the
s1
byte string is less
than, greater than, or equal to the
s2
byte string.
NOTE This feature requires the compiler option STANDARD_LEVEL
'EXT_MODCAL'.
Example
$STANDARD_LEVEL 'EXT_MODCAL'$
program asmb005 (output)
type
pac20 = packed array[1..20] of char;
var
pac,pac1 : pac20;
i : integer;
s : shortint;
c,m : char;
b : boolean;
result : shortint;
begin
s := 4;
pac := 'abcd';
pac1 := 'abcd';
result := cmpbytes( pac,pac1,s );
writeln(result); {2}