sharedusers(
DATABASE
)

The sharedusers( function returns a list of users that are currently using the specified database.


Parameters

This function has one parameter:

database – server name of the database (which may be different than the name on the local computer). If this parameter is missing or empty ("") then the current database will be used (it must be a shared database). If this parameter is "*" then all users on the server associated with the current database will be listed, no matter what databases they have open.


Description

The sharedusers( function returns a list of users that are currently sharing a database. The function has one parameter, the name of the database. The specified database must currently be connected to the server on this computer. If the database is not connected, or is not a sharable database, the result will be "". If the database name is "" (or missing entirely) then the current database will be used.

If this is a connected database, the result will be a carriage return separated array, with each line containing the session id, user name, and user’s computer’s name separated by tabs. Here’s a typical example of the output from this function.

12   Rudy Red       Conference Room Computer
15   Marie Ellis    Marie’s Computer
29   Mark Watson    Mark’s Computer

This example procedure checks to see if the user Rudy Red is using the same shared database we are right now.

if sharedusers() contains ¬+"Rudy Red"+¬
    message "Rudy is online right now!"
endif

The sharedusers( function can also be used to list all users on the server, not just the ones using a specified database. To do this set the database name to "*" (the current database must be a shared database for this to work).


See Also


History

VersionStatusNotes
1.0No ChangeCarried over from Panorama 6.0.