What’s wrong with my code?I’m trying to get a list of notes names, from nested Group names.
When the function calls itself recursively, instead of expanding the name, it just gives the group name again.
so groupMembers, instead of being a nice array like the first time around, is just the group name, again.
Thanks for any help!
Marcia
‘’‘’‘’‘function below’‘’‘’‘’’
in declarations:
Dim view As notesview
Dim entry As notesviewentry
Dim distList() As String
Function RecursivelyExpandGroups(groupName$)
groupMembers = Evaluate( |@ExpandNameList(“servername”:“names.nsf”;“| & groupName$ & |”)| )
Forall nam In groupMembers
Print nam
'check to see if nam is a group:
Set entry=view.getentrybykey(nam,True)
If Not entry Is Nothing Then
'it is a group, expand it
Print nam + " is a group"
n$=nam
Call RecursivelyExpandGroups(n$)
Else
'it's not a group, add it to the distribution list
top%=Ubound(distList)+1
Redim Preserve distList( top% )
distList(top%)= nam
'distList = Arrayappend(distList, nam)
End If
End Forall
End Function