HP Pascal/iX Reference Manual (31502-90022)

9- 21
pac,pac1 : pac20
s : shortint;
result : shortint;
begin
pac1 := apac;
pac := 'thisoisoaotest56789 ';
movebyteswhile( pac, pac1, true, true, true, s );
writeln (s); {20}
writeln('"',pac1,'"'); {"THISOISOAOTEST56789 ")
pac1 := apac;
movebyteswhile( pac, pac1, #1, true, false, s );
writeln (s); {20}
writeln('"',pac1,'"'); {"thisoisoaotest56789 "}
pac1 := apac;
movebyteswhile( pac, pac1, true, #0, false, s );
writeln (s); {15}
writeln('"',pac1,'"'); {"thisoisoaotest "}
end.
scanuntil
Usage
scanuntil
(s, t1, t2, p)
Parameters
s
A PAC or string variable that contains the source string to be
scanned.
t1
An expression whose value is of any char type.
t2
An expression whose value is of any char type.
p
A shortint variable which will indicate the position in the
source byte string where
t1
or
t2
was found.
Result A boolean value.
true : indicates
t2
was found.
false : indicates
t1
was found.
Description
The function scanuntil scans the source byte string until either the
t1
or
t2
is found. The position at which the
t1
or
t2
was found is
returned. The result is a Boolean value indicating whether
t2
or
t1
was
found.
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