HP Pascal/iX Reference Manual (31502-90022)

9- 23
type
pac20 = packed array[1..20] of char;
var
pac : pac20;
s : shortint;
c,m : char;
b : boolean
begin
pac := 'aaaaaaaaabaaaaaaaaaa';
c := 'a';
m := 'c';
b := scanwhile( pac, c, m, s );
writeln (s); {10}
writeln(b); {false}
b := scanwhile( pac, 'a', m, s );
writeln (s); {10}
writeln(b); {false}
b := scanwhile( pac,#98 ,'a', s );
writeln (s); {1}
writeln(b); {true}
end.
waddress
Usage
waddress
(i)
Parameters
i
The name of a variable, procedure, or function.
Description
The function
waddress(i)
returns the byte address of
i
when
i
is a
variable name, and the entry point when it is a procedure or function
name. This variable cannot be type file or a file type component of a
structured variable. Also,
i
cannot be a component of a packed structure
as an argument, except when this component is an element of a PAC.
The
waddress
function is useful for calling copy text from
baddress
.
waddress
returns an integer in the range
minint..maxint
.
NOTE [REV BEG]
waddress
does not work correctly with the $OPTIMIZE compiler option
for addresses of variables. Use type coercion[REV END] and addr
instead. Refer to the
HP Pascal/iX Programmer's Guide
or the
HP
Pascal/HP-UX Programmer's Guide
, depending on your implementation,
for more information on optimizer assumption.
TYPE
rec_type = RECORD
f1: integer;
f2: boolean;
END;
VAR
n: integer;