The !USERNAME() subroutine returns the user login name for a given QM user number.
CALL !USERNAME(name, userno)
DEFFUN USERNAME(userno) CALLING "!USERNAME"
name = USERNAME(userno)
The !USERNAME() subroutine returns name as the login name associated with a given user number. If there is no user logged in with that userno, a null string is returned.
READU INV.REC FROM INV.F, INV.NO
CALL !USERNAME(UNAME, STATUS())
PRINTERR "Invoice is locked by user " : UNAME
The above program fragment displays the login name of the user holding the lock if the READU is blocked by another user.