MyChat Scripts Engine: mRenameUsersGroup, rename a group
Rename a group of users.
Syntax
function mRenameUsersGroup(sOldGroupName, sNewGroupName: string): integer;
Parameters and return values
Parameter |
Type |
Value |
sOldGroupName |
string |
users group old name; |
sNewGroupName |
string |
new group name. |
Function result
0 |
group renamed successfully; |
-1 |
impossible to rename. Group with such name already exists; |
-2 |
group name cannot be empty; |
-10 |
group with specified old name is not found, cannot rename the group. |
Example
const
GROUPNAME = 'Group for testing purposes';
var
s: string;
begin
mCreateUsersGroup(GROUPNAME);
case mRenameUsersGroup(GROUPNAME, GROUPNAME + ' (renamed)') of
0 : s := 'All ok';
-1 : s := 'Group with such name already exists';
-2 : s := 'Group name is empty';
-10 : s := 'Group not found';
end;
mLogScript(s, '');
end.
Script work result
[15:25:52] (Log "mRenameUsersGroup"): everything is OK
[15:25:52] (Run "mRenameUsersGroup"): Script operation time: 13 ms
[15:25:52] (Run "mRenameUsersGroup"): Script done successfully.
See also