Item
Description
Returns the specified item in the collection.
The argument to this method can be either a numeric index (itemNum) or a String (name).
Syntax
VBScript
collection.Item(itemNum)
collection.Item(name)
Perl
$collection->Item(itemNum);
$collection->ItemByName(name);
- Identifier
- Description
- collection
- A Groups collection object, representing the set of groups associated with the current schema repository (master database).
- itemNum
- A Long that serves as an index into the collection. This index is 0-based so the first item in the collection is numbered 0, not 1.
- name
- A String that serves as a key into the collection. This string corresponds to the unique key of the desired Group object.
- Return value
- The Group object at the specified location in the collection.
Example
VBScript
set adminSession = CreateObject("ClearQuest.AdminSession")
adminSession.Logon "admin", "", ""
set groupList = adminSession.Groups
numGroups = groupList.Count
For x = 0 to numGroups -1
set groupObj= groupList.Item(x)
groupName = groupObj.Name
msgbox groupName
Next
Perl
$adminSession= CQAdminSession::Build();
$adminSession->Logon ("admin", "", "");
$groupList = $adminSession->Groups();
$numGroups = $groupList->Count();
for (x = 0;$x < $numGroups ; $x++){
$groupObj = $groupList->Item($x);
$groupName = $groupObj->Name();
print $groupName,"\n";
}
CQAdminSession::Unbuild($adminSession);