PDA

View Full Version : VB Arrays


sage45
07-09-2003, 07:38 AM
Is there anyway that I can find the value UBound.length???

In other words, I am filling an Array dynamically and I need to find the Upper Boundary number:


Dim cont As Object, p As String, pq As Object
Set cont = GetObject("WinNT://"&sData&",computer")
cont.Filter = Array("PrintQueue") 'I need to find the UBound of this
For Each p In cont
Set pq = GetObject(p.ADsPath)
'Script continues and places each collection into a combobox
Next


The reason I need the UBound of this, is because of my progress bar... Right now I have my progress bar using a multiple of the total number of printer objects available on the server(s), it pulls the multiple from an INI file (each server would need a multiple number)... This in itself, doesn't present a problem, with the exception that you have to know the total amount of printer objects on the server... I figure by finding out the Upper Boundary of the Array, it would save the need of having to know the information... Thoughts???

-sage-

Roelf
07-10-2003, 08:46 AM
to find the UBound of an array:

dim upper as Long
upper = UBound(arrayname)