Return value

associated(pointer) returns a scalar value of type logical(4). There are several cases:

When the optional target is not present then associated(pointer) is true if pointer is associated with a target; otherwise, it returns false.

If target is present and a scalar target, the result is true if target is not a zero-sized storage sequence and the target associated with pointer occupies the same storage units. If pointer is disassociated, the result is false.

If target is present and an array target, the result is true if target and pointer have the same shape, are not zero-sized arrays, are arrays whose elements are not zero-sized storage sequences, and target and pointer occupy the same storage units in array element order.

As in case 2, the result is false, if pointer is disassociated.

If target is present and an scalar pointer, the result is true if target is associated with pointer, the target associated with target are not zero-sized storage sequences and occupy the same storage units.

The result is false, if either target or pointer is disassociated.

If target is present and an array pointer, the result is true if target associated with pointer and the target associated with target have the same shape, are not zero-sized arrays, are arrays whose elements are not zero-sized storage sequences, and target and pointer occupy the same storage units in array element order. The result is false, if either target or pointer is disassociated.