MyChat Scripts Engine: mGetUserFullNameByPreset, a user's fullname by template
Function to obtain a name of MyChat user in text format according to the template.
Syntax
function mGetUserFullNameByPreset(iUIN, iStyle: integer): string;
Parameters and return values
Parameter |
Type |
Value |
iUIN |
integer |
unique user identifier; |
iStyle |
integer |
template type, by which the name is constructed. (The template consists of the name, middle name, last name, user's nickname). Variants: 0 — "Stephen Edwin King"; 1 — "King Stephen Edwin"; 2 — "King S.E."; 3 — "S.E. King"; 4 — "King Stephen"; 5 — "Stephen King"; 6 — "Stephen Edwin"; 7 — "King"; 8 — "Stephen". |
Function result
Text string, the user's full name according to the template. If you specify a nonexistent UIN, returns an empty string. If there are not enough data for the template (name, middle name, last name), the function displays the nickname. This parameter is necessary for MyChat, and the user has it anyways.
Example
var
i: integer;
begin
for i := 0 to 8 do
mLogScript(mGetUserFullNameByPreset(6, i), inttostr(i));
end.
Script work result
[15:35:18] (Log "mGetUserFullNameByPreset"): [0] Stephen Edwin King
[15:35:18] (Log "mGetUserFullNameByPreset"): [1] King Stephen Edwin
[15:35:18] (Log "mGetUserFullNameByPreset"): [2] King S. E.
[15:35:18] (Log "mGetUserFullNameByPreset"): [3] S. E. King
[15:35:18] (Log "mGetUserFullNameByPreset"): [4] King Stephen
[15:35:18] (Log "mGetUserFullNameByPreset"): [5] Stephen King
[15:35:18] (Log "mGetUserFullNameByPreset"): [6] Stephen Edwin
[15:35:18] (Log "mGetUserFullNameByPreset"): [7] King
[15:35:18] (Log "mGetUserFullNameByPreset"): [8] Stephen