Array out of bounds

Results 1 to 2 of 2

Thread: Array out of bounds

  1. #1
    Join Date
    Dec 1969

    Default Array out of bounds

    arrAlt() is three textfields and arrCorrect() is three radiobuttons, but the below code doesn&#039;t work since unchecked radiobuttons doesn&#039;t return a value and arrCorrect() will only contain 1 index. This causes the loop to crash since, in the second iteration, arrCorrect(1) will be out of bounds.<BR><BR>Please tell me I can fix this without changing to separately named radiobuttons or checkboxes. :-)<BR><BR>&#060;%<BR>arrAlt = Split(Request.Form("Alternative"), ",")<BR>arrCorrect = Split(Request.Form("Correct"), ",")<BR><BR>For i = 0 To UBound(arrAlt)<BR>objConn.Execute("INSERT INTO tblAlternatives (QID, Correct, Alternative) VALUES (" & intIdent & ", " & CBool(arrCorrect(i)) & ", &#039;" & arrAlt(i) & "&#039;)")<BR>Next<BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default Nope, can't tell you that.

    Separate names are the only way to fly with checkboxes and radio button groups and &#060;SELECT MULTIPLE&#062;.<BR><BR>

Posting Permissions

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