The INSTANCE# keyword determines whether certain requests will
be processed with an instance number comparison. Instance number
comparisons can be used to ensure that the expected instance of the
note is being processed. If the creator of the note pad specified
INSTCOMP=REQUIRED on the create note pad request, instance number
comparisons are mandatory when writing, replacing, or deleting an
existing note. Instance number comparisons are optional for read
note requests.
If INSTANCE#=IGNORE is specified, or taken as the default, no instance
number comparison is performed when processing the request.
Otherwise the INSTANCE# keyword identifies a storage area containing
the instance number for the note. Depending on the request and its
result, XCF might fetch an instance number from this storage area,
or store an instance number in this storage area, or both. If the
value fetched from the instance number storage area is zero, no instance
number comparison is performed for the request.
- For a create note request, the IXCNOTE macro expansion stores
the instance number of the note in the designated storage area upon
return from the XCF Note Pad Services. The instance number is valid
for use if the create request is either successful or rejected because
the note already exists. Otherwise the stored instance number value
is not valid for use (normally the stored value will be zero).
- For a write note request, the IXCNOTE macro expansion extracts
the instance number from the designated storage area and calls the
XCF Note Pad Services. If the designated note does not exist, the
note is created and the instance number is set to a value determined
by XCF. The specified input instance number is irrelevant and totally
ignored in this case. If the designated note does exist, the note
is replaced if the specified instance number is either zero or equal
to the current instance number of the note (and the request is otherwise
valid). Otherwise the request is rejected due to an instance number
mismatch.
Upon return from the XCF Note Pad Services, the IXCNOTE
macro stores an instance number in the designated storage area. The
instance number is valid for use if the write request was successful,
or if the request was rejected due to either an instance number mismatch
or a low tag value. Otherwise the instance number is not valid for
use (normally the stored value will be the same as the original input
value).
- For a read, replace, or delete request, the IXCNOTE macro expansion
extracts the instance number from the designated storage area and
calls the XCF Note Pad Services. If the designated note does not
exist, the request is rejected. If the designated note does exist,
the request is processed if the specified instance number is either
zero or equal to the current instance number of the note (and the
request is otherwise valid). Otherwise the request is rejected due
to an instance number mismatch.
Upon return from the XCF Note Pad
Services, the IXCNOTE macro stores an instance number in the designated
storage area. The instance number is valid for use if the request
was successful, or if the request was rejected due to either an instance
number mismatch or a low tag value. Otherwise the instance number
is not valid for use (normally the stored value will be the same as
the original input value).
Independently of the INSTANCE# specification, note that the metadata
stored in the answer area (if any) includes the instance number for
the note.