SetListMembers

Description

Sets the members in a named list.

For Perl, note that this parameter is an array, so no delimiter is needed to separate member items.

Syntax

VBScript


session.SetListMembers listName, (Members) 

Perl


$session->SetListMembers(listName, Members); 
Identifier
Description
session
The Session object that represents the current database-access session.
listName
A String containing the name of the list.
Members
For VBScript, a Variant array of strings containing the members of the list.

For Perl, a reference to an array of strings containing the members of 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, ""

Dim NewValues(2)
    NewValues(0) = "ABC"
    NewValues(1) = "123"
    NewValues(2) = "XYZ"

DynamicListNamesRef = sessionObj.GetListDefNames

set ListName = DynamicListNamesRef(0)   

print ListName   

sessionObj.SetListMembers ListName, (NewValues)

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();

$ListName = @$ListDefNamesREF[0];

# Use SetListMembers() to set the list to a specific list of values...

print "\nSetting list '$ListName' to ('ABC', '123', 'XYZ')...\n";

@NewValues = ('ABC', '123', 'XYZ');

$sessionObj->SetListMembers($ListName, \@NewValues);

$members = $sessionObj->GetListMembers($ListName);

#print out the list members
foreach $member (@$members){
   print $member, "\n";   
   }