AddListMember

Description

Adds a list member to the named list.

Syntax

VBScript


session.AddListMember listName, listMember 

Perl


$session->AddListMember(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

' For one of the lists, print out its members...

set ListName = DynamicListNamesRef(0)

   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 

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";
   }