Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21251

[RESOLVED] Problem with Ubound

$
0
0
In the code below Names = "name1,name2"

After the Split a (0) = "name1" and a(1) = "name2"

Ubound shows a value of 1

In the For loop a(0) gets processed. It loops and a(1) gets processed.

It loops again and I get Subscript out of range (of course). The problem is why does it
loop for a third time?

Code:

  '
  '
     
      a = Split(Names, ",")
     
      For n3 = 0 To UBound(a) - 1
        s = GetName(a(n3))
            '
            '
      Next n3
  '
  '


Viewing all articles
Browse latest Browse all 21251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>