I was just going to add I think UniData has the STATUS() function.  So I test 
locks
like:

** Read vendor & route selection
READU VREC FROM APVENDOR, VENDNO LOCKED
   LOCK.SW    = 1
   FileString = NULL$
   LogFlag    = NULL$
   CALL LOCK.MSG (FileString, LogFlag, LockMsg) ; LockMsg :="  Press [Enter]."


Then the locking subroutine looks like:

SUBROUTINE LOCK.MSG ( FileString, LogFlag, LockMsg )
*
** Get user# who has the lock
PIBS.ID = STATUS()                                     ; ** U2 version
*
** Initialize what's locked
IF Filestring NE NULL$ THEN
  MSG1 = FileString:" LOCKED by "
END ELSE
  MSG1 = "Record LOCKED by "
END
*
** Figure out who has the record locked
LOCK.ID   = PIBS.ID                                    ; ** U2 version
LOCK.NAME = GETUSERNAME(PIBS.ID)                       ; ** UD version
*LOCK.NAME = CALL GET.USERS(PIBS.ID)                    ; ** UV version
*
** Assign the message to return
LockMsg = MSG1 : LOCK.NAME : " (port# " : PIBS.ID : ")."
*
** Create log if requested
IF LogFlag THEN
   CALL LOGMSG ('', '', LockMsg, '')
END
*
RETURN
END

The more I can do within U2 the more portable the code is when I'm using both 
Windows
and Linux.

Bill
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to