Results 1 to 2 of 2

Thread: Pass a value of integer type to access array...

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2004
    Posts
    49

    Question Pass a value of integer type to access array...

    May I know what is the reason that I'm not able to access the character in the array? Is there a way to solve this problem or I've made a small mistake?

    ' Generate Random Caps Characters
    Private Function randomCaps() As Char
    Dim charCapsArr() As Char = "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
    Dim randNum As Integer
    Dim rn As Random
    randNum = rn.Next(0, 25)
    randomCaps = charCapsArr(randNum)
    Return randomCaps
    End Function
    ______________________________________

    Warmest Regards,

    Lex
    ______________________________________



    :|: Don't Mess With The Predator :|:

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Pass a value of integer type to access array...

    Have you stepped through the code and checked out the value randNum was acquiring?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width