HP Pascal/iX Reference Manual (31502-90022)

9- 20
pac := 'aacd';
pac1 := 'abcd';
result := cmpbytes( pac,pac1,s );
writeln(result); {0}
pac := 'abcd';
pac1 ;= 'aacd';
result := cmpbytes( pac,pac1,s );
writeln(result); {1}
end.
movebyteswhile
Usage
movebyteswhile
(s, t, a, n, u, p)
Parameter
s
A PAC or string variable that contains the source string to be
copied.
t
A PAC or string variable to which the source is to be copied.
a
An ordinal constant expression whose ordinal value is 0 or 1,
indicating whether the copy is to continue while the
characters are alphabetic (1).
n
An ordinal constant expression whose ordinal value is 0 or 1,
indicating whether the copy is to continue while the
characters are numeric (1).
u
An ordinal constant expression whose ordinal value is 0 or 1,
indicating whether the copied characters remain the same (0),
or whether all lowercase characters are upshifted (1).
p
A shortint variable which will indicate the index in the
source array where the test condition, alpha or numeric,
failed.
Description
The procedure movebyteswhile moves a byte from the source array to the
target array if the byte meets the test conditions set by
a
or
n
. Once
the condition fails, the
p
of the byte is returned. If
u
is set, each
alphabetic character moved to the target array is upshifted. Either or
both of
a
and
n
must evaluate to 1. If neither evaluates to 1, then the
results are unpredictable.
The length field of a target string variable is not updated.
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;
const
apac = pac20[20 of ' '];
var