以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  这个报错信息是为什么?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=119932)

--  作者:asdf44168
--  发布时间:2018/6/4 13:56:00
--  这个报错信息是为什么?
.NET Framework 版本:2.0.50727.3649
Foxtable 版本:2018.3.9.1
错误所在事件:窗口,双色球号码遗漏次数统计,Button1,Click
详细错误信息:
Index was outside the bounds of the array.


--  作者:asdf44168
--  发布时间:2018/6/4 14:01:00
--  
这段代码有问题吗?怎么老报以上错误?是不是foxtable软件有问题?

Dim ylzcxcs(127),rednum(5) As Integer
Dim lst10 As new List(of Integer)
Dim nbox As WinForm.NumericComboBox
Dim qnum,dqylz,tempnum As Integer

\'Dim tstart,tend As Date
\'
\'tstart = Date.Now
\'
nbox = e.Form.Controls("Numbox1")
qnum = nbox.Value

MessageBox.Show("开始!", "提示", MessageBoxButtons.OK)

For i1 As Integer = 1 To 6
    lst10.add(0)
Next

For i2 As Integer = 1 To 128
    ylzcxcs(i2 - 1) = 0
Next

Dim rnumb As Integer = Tables("双色球已开奖号码组合").Rows.Count
Dim rnume As Integer = Tables("双色球号码遗漏次数统计").Rows.Count

With Tables("双色球号码遗漏次数统计")
    For k As Integer = rnume To 1 Step -1
        .Rows(k -1).Delete()
    Next
End With
MessageBox.Show("开始统计!", "提示", MessageBoxButtons.OK)

dqylz = 0
tempnum = 0
For i As Integer = 1 To rnumb
    Dim rb As Row = Tables("双色球已开奖号码组合").Rows(i - 1)
    rednum(0) = rb("num1")
    rednum(1) = rb("num2")
    rednum(2) = rb("num3")
    rednum(3) = rb("num4")
    rednum(4) = rb("num5")
    rednum(5) = rb("num6")
    
    
    For i3 As Integer = 1 To 6
        lst10(i3 - 1) = rednum(i3 - 1)
    Next
    
    MessageBox.Show("开始计算遗漏值!", "提示", MessageBoxButtons.OK)
    
    If lst10.Contains( qnum ) = False Then
        dqylz = dqylz + 1
    Else
        tempnum = dqylz
        MessageBox.Show("开始计算次数!", "提示", MessageBoxButtons.OK)
        
        ylzcxcs(tempnum - 1) = ylzcxcs(tempnum - 1) + 1
        dqylz = 0
        tempnum = 0
    End If
    
Next


--  作者:有点甜
--  发布时间:2018/6/4 14:17:00
--  

下面代码有问题,必须在 0-127 之间才行

 

msgbox(tempnum)

ylzcxcs(tempnum - 1) = ylzcxcs(tempnum - 1) + 1