Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Posts
    567
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Why am I getting subscript out of range error?

    I can't see it. Subscript out of range in this loop. I have tried several variations of counting but haven't been right yet.

    Thanks for looking.

    Code:
    	For Each fld in RS.Fields 
     	  fldName(intCount)=fld.name
     	  fldvalue(intCount)=fld.value
     	  fldlength=trim(len(fld.value))
    	  response.write(fldName & "  Value=" & fldvalue & "  Length=" & fldlength & "<br>")
    	Next
    Scott Stewart
    Always happy to learn from pros.

  • #2
    Regular Coder
    Join Date
    Nov 2002
    Posts
    567
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Because you need to use redim not dim on dynamic arrays, moron!
    Scott Stewart
    Always happy to learn from pros.

  • #3
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Please be nice to yourself ...

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ScottInTexas, please refrain from calling people names.

    That's definitely doesn't reflect well on you.

    Even if you're calling yourself names. :P
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #5
    Regular Coder
    Join Date
    Nov 2002
    Posts
    567
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Whoa!

    Just read the replies. I apologize, even to myself. Frustration got the better of me. You know how it is. You're going along nicely, code flows from your fingertips. The logic is all there. Then suddenly something you have been doing for years escapes you and your code errors out . You just KNOW your syntax is right. You finally break down and post the question just knowing that there are a bunch of people going to see this and think "Get a grip dude. Your losing it on a simple syntax problem." Then, before anyone can reply you get the answer. Now I could have just deleted my post, but then someone else would not have benefitted from my mental block and subsequent clear up.

    Thanks.
    Scott Stewart
    Always happy to learn from pros.

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I was just kidding, anyway. I know EXACTLY how that goes.

    I've done that a number of times - about to pull my hair out, I call another developer over to go through the code with me. As I'm showing him how it works and what I'm doing, I realize exactly what I did wrong, and say "uhh... never mind".

    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

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