Instead of making it global, I usually make these kind of views static. So your code would look something like:
static userView as NotesView
If not userView is Nothing then
Set userView = web.directory.getView("($VIMPeople)")
userView.AutoUpdate = false
End If
...rest of the code below
The first time you hit the function, it grabs the view. The next time you call the function in your loop, it already has the view so you don't get the performance hit. Is there a huge difference between making it Global and static? Probably not other than keeping down the number of Global variables.
Instead of making it global, I usually make these kind of views static. So your code would look something like:
static userView as NotesView
If not userView is Nothing then
Set userView = web.directory.getView("($VIMPeople)")
userView.AutoUpdate = false
End If
...rest of the code below
The first time you hit the function, it grabs the view. The next time you call the function in your loop, it already has the view so you don't get the performance hit. Is there a huge difference between making it Global and static? Probably not other than keeping down the number of Global variables.