Hi there:
I have the following code in an agent which gets all department names from a view and places them into a dynamic array. The code seems to run well. At this point, I just want to verify that the department names are in fact in the array, so I’m trying to print the array to the console. I’m getting the right number of entries in the array, but I can’t seem to print the department names to the console. Here is my code:
Sub GetDepartments
Dim DeptView As NotesView
Dim DeptViewEntryColl As NotesViewEntryCollection
Dim DeptViewEntry As NotesViewEntry
Dim Depts() As Variant '*** Array which holds the department names
Dim i As Integer
Dim n As Integer
Set DeptView = dbGlobal.GetView("EngDepartmentLookup")
Set DeptViewEntryColl = DeptView.AllEntries
Set DeptViewEntry = DeptViewEntryColl.GetFirstEntry
i = 0
While Not DeptViewEntry Is Nothing
Redim Depts(i)
Depts(i)=Cstr(DeptViewEntry.ColumnValues(0))
i = i + 1
Set DeptViewEntry = DeptViewEntryColl.GetNextEntry(DeptViewEntry)
Wend
n=0
While n < Ubound(Depts)
Msgbox "Department name is " + Depts(n)
n=n+1
Wend
Msgbox "Number of departments is " + Cstr(Ubound(Depts)+1)
End Sub