need help (part II)

dfcn

Newcomer
Joined
Mar 22, 2003
Messages
5
Visual Basic:
        If mcqChk.Checked = True Then
            qnManagement.addMCQqn(MCQqnTf.Text, MCQ1.Text, MCQ2.Text, MCQ3.Text, _
            MCQ4.Text, corrAnswer)

        ElseIf fillChk.Checked = True Then
            qnManagement.addFillQn(fillTf.Text, fillAnsTf.Text)

        End If

this arguement is supposed to call for these 2 method in my module when i click button A

Visual Basic:
Public Function addMCQqn(ByVal quest As String, ByVal ans1 As String, _
                    ByVal ans2 As String, ByVal ans3 As String, _
                     ByVal ans4 As String, ByVal corrAns As String)
        isMCQ(arrPosM) = entryForm.qnNum
        qnTypes(arrayPos) = "M"
        arrPosM += 1
        mcqQn(arrayPos) = quest
        mcqAns1(arrayPos) = ans1
        mcqAns2(arrayPos) = ans2
        mcqAns3(arrayPos) = ans3
        mcqAns4(arrayPos) = ans4
        correctAns(arrayPos) = corrAns
        MessageBox.Show("Question Submitted" & vbCr & isMCQ.Length & vbCr & isFill.Length)
        arrayPos += 1
        ReDim Preserve isMCQ(arrPosM)
        ReDim Preserve isFill(arrPosF)
        ReDim Preserve isMCQ(arrayPos)
        ReDim Preserve qnTypes(arrayPos)
        ReDim Preserve mcqQn(arrayPos)
        ReDim Preserve mcqAns1(arrayPos)
        ReDim Preserve mcqAns2(arrayPos)
        ReDim Preserve mcqAns3(arrayPos)
        ReDim Preserve mcqAns4(arrayPos)
        ReDim Preserve correctAns(arrayPos)

    End Function

    Public Function addFillQn(ByVal quest As String, ByVal answer As String)


        isFill(arrPosF) = entryForm.qnNum
        qnTypes(arrayPos) = "F"
        arrPosF += 1

        fillQn(arrayPos) = quest
        fillAns(arrayPos) = answer
        MessageBox.Show("Question Submitted" & vbCr & isMCQ.Length & vbCr & isFill.Length)
        arrayPos += 1
        ReDim Preserve isMCQ(arrPosF)
        ReDim Preserve fillQn(arrayPos)
        ReDim Preserve fillAns(arrayPos)
    End Function

for the 1st time..when i press the button A...it is successful..after that when i changed the checked radio button for the second time and click button A..it says the array is out of the index bound...i dont get it...cause when i only have one method..it works fine...

anyone knows where the fault lies?
 
Let the program run once more.
Reproduce the error.

The IDE will mark exactly the line that produced the error.

Now move the mousepointer over the variables in that line, one after the other. You will be shown the variables' values. Somewhere there the error is hidden.

(If moving the mousepointer doesn't work the use the command window (Ctrl-Alt-A))
 
Heiko said:
Let the program run once more.
Reproduce the error.

The IDE will mark exactly the line that produced the error.

Now move the mousepointer over the variables in that line, one after the other. You will be shown the variables' values. Somewhere there the error is hidden.

(If moving the mousepointer doesn't work the use the command window (Ctrl-Alt-A))

thansk dude...
i found the dumb error :D
 
Back
Top