The 197613 is the ID of the user session.  The trick is to translate
this to a user ID.  SB+ appears to be doing this with the SB.DISP.LOCK
routine, though I'm not certain how they're doing that translation.

Oh, here's a thought.  From BASIC, EXECUTE a LIST.READU, capture the
output, and then trim each line of the response.  Once a line is
trimmed, field out the process ID in the third position; if it's the
process ID returned by STATUS() then get the port number from the
first position.  You could then use that to read the $PASSport record
which will tell you who is logged in on that port (in <7>) and a whole
bunch of other stuff.

-Kevin
[EMAIL PROTECTED]
http://www.PrecisOnline.com

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike Randall
Sent: Thursday, April 14, 2005 8:48 AM
To: [email protected]
Subject: RE: [U2] Locks, releases and STATU() (oh my)

Think LIST.READU is what you are looking for.   LIST.LOCKS only
displays the
64 semaphore locks which I don't think are too common anymore.

Trick with LIST.READU was equating the file number to the  proper data
file if you were  doing it programmatically.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Susan Joslyn
Sent: Thursday, April 14, 2005 10:33 AM
To: [email protected]
Subject: [U2] Locks, releases and STATU() (oh my)

Hello wizards,

I've read what I can find on the subject, but I'm not finding what I
need.
As usual, anyone who knows where the info is, I would not be the least
bit offended if you just point.  Or if you know off-hand ...

(Presently grappling with Unidata):

When I hit a lock with a:
READU this FROM that,ID LOCKED locked clause ELSE whatever 

LIST.LOCKS from TCL has always been worse than useless for me.  For
example at this exact moment I'm holding locks on 3 sessions, yet if I
run LIST.LOCKS on a 4th session it displays ABSOLUTELY NOTHING.  

I don't see much on offer in the LOCKED clause, although the online
help suggests that STATUS() will return the user number of the lock it
ran into.
Can't understand its output... I have a very short program that
displays STATUS(), opens the file and displays STATUS() then does a
READU against an item I purposefully have locked on another session
and I display STATUS()  a third time.  What do you suppose its giving
me, and what can I do with it?

1 STATUS = 0     <-- beginning of program
2 STATUS = 1     <-- after the open
3 STATUS = 197613 <-- this is what it gives me after the READU against
a locked item

What I want to do is determine who/what has the lock, tell the user, I
also want to be able to carry on under my own conditions when ud 46
flag is set which will by default allow edits to items I've locked
against my own session.  Which is too loose -- I want to check to make
sure I'm in the exact right condition to do that and I'm not sure how
I can (by seeing what is holding the lock) but ... does anyone know
how to get ANY information out of a lock?

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


--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.10 - Release Date: 4/14/2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.10 - Release Date: 4/14/2005
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to