How do I determine which port has a specified record locked?

There is an unsupported UniBasic CALL, $WHOLOCK, that returns the port number. The syntax for $WHOLOCK is:

    CALL $WHOLOCK, C, R, P

    C - the opened channel number
    R - the locked record number
    P - returns port number that has the record locked, or -1 if record is no longer locked

In a networked environment, CALL $WHOLOCK can only identify ports on the host system. Due to this limitation and other system dependencies, we recommend that CALL $WHOLOCK should only be used for administrative purposes and not made an essential part of an application.