MsgCommunicator: Delphi Instant Messaging (IM) SDK
for easy creation of custom messenger system


TMsgClient.FindUsers
TMsgClient
Top 

Search for the registerd users on the server by user details.

function FindUsers(
                    var Users:                    TMsgUserInfoArray;
                    var UserNameComparison:       TMsgTextComparison;
                    var FirstNameComparison:      TMsgTextComparison;
                    var LastNameComparison:       TMsgTextComparison;
                    var OrganizationComparison:   TMsgTextComparison;
                    var DepartmentComparison:     TMsgTextComparison;
                    var ApplicationComparison:    TMsgTextComparison;
                    var HostComparison:           TMsgTextComparison;
                    var PortComparison:           TMsgIntegerComparison;
                    Status:                       TMsgUserStatus = msgNone;
                    UserID:                       Cardinal = MSG_INVALID_USER_ID;
                    UserName:                     ShortString = '';
                    FirstName:                    ShortString = '';
                    LastName:                     ShortString = '';
                    Organization:                 ShortString = '';
                    Department:                   ShortString = '';
                    Host:                         ShortString = '';
                    Application:                  ShortString = '';
                    SearchCondition:              String = ''; 
                    SortBy:                       TMsgUserInfoArraySortBy = msgusbNone;
                    Ascending:                    Boolean = True;
                    OrderByClause:                String = ''
                  ): Integer;


Description
Call FindUsers to find the registered users on the server with conditions and optional sorting.
Default value of any parameter in FindMessages means no condtion on this value.
You must be connected to the server before calling FindMessages.
The Database property of TMsgServer in server application must be assigned before using this method.

Look at demos in Demos\Databases for example.

Parameter  
Meaning
Users
UserNameComparison
FirstNameComparison
LastNameComparison
OrganizationComparison
DepartmentComparison
ApplicationComparison
HostComparison
PortComparison
Status
UserID
UserName
FirstName
LastName
Organizatio
Department
Host
Application
SearchCondition

SortBy
Ascending

OrderByClase
array with registration data of found users
UserName search condition
FirstName search condition
LastName search condition
Organization search condition
Department search condition
Application search condition
Host search condition
Port search condition
user status
unique ID of the user
UserName search string
FirstName search string
LastName search string
Organization search string
Department search string
Host search string
Application search string
SQL WHERE clause without word WHERE. Example: (Host = "192.168.1.1") AND (LOWER(Application) LIKE "%client%")
Sorting type for Users array
If SortBy is specified then Ascending determines if search is ascending or not
SQL ORDER BY clause without words ORDER BY. Example: SenderID DESC, SendingDate ASC.


FindUsers sends command to the server, waits for the answer and returns array of found users if result code is MSG_COMMAND_OK.

FindUsers can return one of the following error codes:

Name
Value
MSG_Error_FindUsers_NotConnected
60061
MSG_Error_FindUsers_SendCommandFailed
60062
MSG_Error_FindUsers_ReceiveResultFailed
60063
MSG_Error_FindUsers_InvalidParams
60064
MSG_Error_FindUsers_InvalidServerReply
60065
MSG_Error_FindUsers_Failed
60066
MSG_Error_FindUsers_DatabaseIsNotAssigned
60067





© AidAim Software MsgCommunicator: Delphi Messenger Sdk Instant Messaging Sdk Im Sdk