Getting a list of user UINs by their nicknames and network statuses.

 

Syntax

function mGetUsersListByNickAndState(sNick: string; iState: integer): string;

 

Parameters and return values

Parameter

Type

Value

sNick

string

user nickname, the letter case is not important;

iState

integer

user status.

 

Function result

String with user UINs separated by commas. If no use is found, the function returns an empty string.

 

Example


const
  NICK = 'admin';
var
  sUINS, sUIN, sEmail, sDisplayName: string;
begin
  sUINS := mGetUsersListByNickAndState(NICK, -2);
  
    if length(sUINS) > 0 then begin
      mLogScript(sUINS, '');
        while length(sUINS) > 0 do begin
          sUIN := Fetch(sUINS, ',');
          sDisplayName := mGetUserAttribute(StrToInt(sUIN), 'DisplayName');
          sEmail := mGetUserAttribute(StrToInt(sUIN), 'Email');
          
            if length(sEmail) = 0 then sEmail := '-';
          
          mLogScript('Name: ' + sDisplayName + ', Email: ' + sEmail, 'UIN ' + sUIN);
        end;
    end else mLogScript('No users found', '');
end.


Script work result

[18:43:19] (Log "mGetUsersListByNickAndState"): 1,13632,13676,15878

[18:43:19] (Log "mGetUsersListByNickAndState"): [UIN 1] Name: admin, Email: -

[18:43:19] (Log "mGetUsersListByNickAndState"): [UIN 13632] Name: admin, Email: support@gmail.com

[18:43:19] (Log "mGetUsersListByNickAndState"): [UIN 13676] Name: admin, Email: alex@oneminute.mail

[18:43:19] (Log "mGetUsersListByNickAndState"): [UIN 15878] Name: ADMIN, Email: chief@mail.com

[18:43:19] (Run "mGetUsersListByNickAndState"): Script operation time: 10 ms

[18:43:19] (Run "mGetUsersListByNickAndState"): Script done successfully.

 

See also

Fetch

Length

mGetUserAttribute

mLogScript

StrToInt