HGetState
You can use theHGetState
function to get the current properties of a relocatable block (perhaps so that you can change and then later restore those properties).
FUNCTION HGetState (h: Handle): SignedByte;
h
- A handle to a relocatable block.
DESCRIPTION
TheHGetState
function returns a signed byte containing the flags of the master pointer for the given handle. You can save this byte, change the state of any of the flags, and
then restore their original states by passing the byte to theHSetState
procedure, described next.You can use bit-manipulation functions on the returned signed byte to determine the value of a given attribute. Currently the following bits are used:
Bit Meaning 0-4 Reserved 5 Set if relocatable block is a resource 6 Set if relocatable block is purgeable 7 Set if relocatable block is locked If an error occurs during an attempt to get the state flags of the specified relocatable block,
HGetState
returns the low-order byte of the result code as its function result. For example, if the handleh
points to a master pointer whose value isNIL
, then the signed byte returned byHGetState
will contain the value -109.ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit forHGetState
are
Registers on entry A0 Handle whose properties you want to get
Registers on exit D0 Byte containing flags RESULT CODES
noErr 0 No error nilHandleErr -109 NIL
master pointermemWZErr -111 Attempt to operate on a free block