DeleteListMember
Description
Deletes a member from a named list.
Syntax
VBScript
session.DeleteListMember
listName, listMember
Perl
$session->DeleteListMember
(listName, listMember);
- Identifier
- Description
- session
- The Session object that represents the current database-access session.
- listName
- A String containing the name of the list.
- listMember
- A String containing the member in the list.
- Return value
- None.
Examples
VBScript
' This example assumes there is at least 1 dynamic list
' in the current database-access session.
set sessionObj = GetSession
sessionObj.UserLogon "admin", "", "SAMPL", AD_PRIVATE_SESSION, ""
' Get a list of the names of Dynamic Lists that exist in this database...
DynamicListNamesRef = sessionObj.GetListDefNames
' Get the name of one of the lists
set ListName = DynamicListNamesRef(0)
print ListName
' Get the names of the list members
members = sessionObj.GetListMembers(ListName)
' print out the list members...
For Each member In members
print member
Next
' Add a member, then print the list again...
set newMember = "XYZ"
MsgBox "Adding member: " + newMember + " to list" + ListName
sessionObj.AddListMember ListName, newMember
members = sessionObj.GetListMembers(ListName)
' print out the list members...
For Each member In members
print member
Next
' Now delete a member, and print the list again...
MsgBox "Deleting member: " + newMember + " from list"
sessionObj.DeleteListMember ListName, newMember
members = sessionObj.GetListMembers(ListName)
' print out the list members...
For Each member In members
print member
Next
Perl
# This example assumes there is at least 1 dynamic list
# in the current database-access session.
$sessionObj = $entity->GetSession();
$sessionObj->UserLogon("admin","","SAMPL","");
# Get a list of the names of Dynamic Lists that exist in this database...
$ListDefNamesREF = $sessionObj->GetListDefNames();
# For one of the lists, print out its members...
$ListName = @$ListDefNamesREF[0];
Print $ListName, "\n";
$members = $sessionObj->GetListMembers($ListName);
foreach $member (@$members){
print $member, "\n";
}
# Add a member, then print the list again...
$NewValue = "XYZ";
print "\nAdding member '$NewValue' to list '$ListName'...\n";
$sessionObj->AddListMember($ListName, $NewValue);
$members = $sessionObj->GetListMembers($ListName);
foreach $member (@$members){
print $member, "\n";
}
# Remove the item you just added...
print "\nDeleting member '$NewValue' from list '$ListName'...\n";
$sessionObj->DeleteListMember($ListName, $NewValue);
# Print the list again
$members = $sessionObj->GetListMembers($ListName);
foreach $member (@$members){
print $member, "\n";
}