MyChat Scripts Engine: mGetDepartmentIDByTextPath, get a department's ID by its full path
Getting the identifier of a group by full path name in a common contact list.
Syntax
function mGetDepartmentIDByTextPath(sPath: string): integer;
Parameters and return values
Parameter |
Type |
Value |
sPath |
string |
full path to the group, beginning from a root of the tree-like list. The letter case is important. The delimiter is the backslash ("\"). |
Function result
>0 |
group identifier; |
-1 |
invalid path specified. |
Example
var
iID: integer;
begin
iID := mGetDepartmentIDByTextPath('MyChat\Teamleads deevelopers');
mLogScript(inttostr(iID), '');
end.
Script work result
[19:58:02] (Log "mGetDepartmentIDByTextPath"): 13
[19:58:02] (Run "mGetDepartmentIDByTextPath"): Script operation time: 5 ms
[19:58:02] (Run "mGetDepartmentIDByTextPath"): Script done successfully.