By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,162 Members | 1,050 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,162 IT Pros & Developers. It's quick & easy.

My loop doesn't pick the last value

P: 91
hey people,

please help me on this i can't get the point why the last 2 text field value is not picked its blank
Expand|Select|Wrap|Line Numbers
  1. Checkbox1= Request.Form("same")
  2. Comments=Request.Form("Comments")
  3. strDate=Request.Form("Date")
  4. a=Split(Comments ,",")
  5. c=Split(strDate,",")
  6. b=Split(Checkbox1,",") 
  7. TextBoxValue=UBound(c)
  8. checkboxValue=UBound(b)
  9. 'Response.Write TextBoxValue
  10. redim AssetId(checkboxValue)
  11. redim DateofReturned(checkboxValue)
  12. redim comments(checkboxValue)
  13. for i=0 to checkboxValue
  14. Response.Write a(i)
  15. Response.Write c(i)
  16. count=count+1
  17. next 
But when i do it with for each it work fine
Expand|Select|Wrap|Line Numbers
  1. for each iA in c
  2. DateofReturned=iA
  3. Response.Write DateofReturned
  4. next
how can i retrieve the index array of it Please help
Apr 2 '12 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 10K+
P: 12,369
That's because you're using the upper bound of the wrong array. You're using the upper bound of array b when you're trying to access array a and c.
Apr 2 '12 #2

P: 91
hey thanx now how would i pick those three values and insert it into a table can u give me the logic of it please
Apr 3 '12 #3

Expert Mod 10K+
P: 12,369
If everything else is working, and I can only assume otherwise because you haven't stated that anything else is wrong, all you need to do is use the upper bound of the correct array.
Apr 3 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.