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.

Syntaxe

VBScript

session.SetListMembers listName, (Members) 

Perl

$session->SetListMembers(listName, Members); 
Identificateur
Description
session
Objet Session représentant la session en cours d'accès à la base de données.
listName
A String containing the name of the list.
Membres
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.

Valeur de retour
Aucune.

Exemples

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

Commentaires