-- 作者:发财
-- 发布时间:2014/4/16 15:57:00
-- 自动搜索
Dim r As Table = Tables("成绩表") For i As Integer = 0 To r.Rows.Count -1 Dim Sum1 As Double = r.rows(i)("评委1") Dim Sum2 As Double = r.rows(i)("评委2") Dim Sum3 As Double = r.rows(i)("评委3") Dim Sum4 As Double = r.rows(i)("评委4") Dim Sum5 As Double = r.rows(i)("评委5") Dim Sum6 As Double = r.rows(i)("评委6") Dim Sum7 As Double = r.rows(i)("评委7") Dim Sum8 As Double = r.rows(i)("评委8") Dim Sum9 As Double = r.rows(i)("评委9") Dim Sum10 As Double = r.rows(i)("评委10") Dim Sum11 As Double = r.rows(i)("评委11") Dim Sum12 As Double = r.rows(i)("评委12") Dim Sum13 As Double = r.rows(i)("评委13") Dim Sum14 As Double = r.rows(i)("评委14") Dim Sum15 As Double = r.rows(i)("评委15") Dim Sum16 As Double = r.rows(i)("评委16") r.Rows(i)("最大") = Functions.Execute("最大值",sum1,sum2,sum3,sum4,sum5,sum6,sum7,sum8,sum9,sum10,sum11,sum12,sum13,sum14,sum15,sum16) r.Rows(i)("最小") = Functions.Execute("最小值",sum1,sum2,sum3,sum4,sum5,sum6,sum7,sum8,sum9,sum10,sum11,sum12,sum13,sum14,sum15,sum16) Next 上述代码应放在那里,才搜索最大值、最小值,我现在用命令按钮才生效,我希望输入16个评委的数据后能用上述代码自动搜索?
|
-- 作者:发财
-- 发布时间:2014/4/16 17:16:00
--
Dim r As Table = Tables("成绩表") For i As Integer = 0 To r.Rows.Count -1 Dim Names As New List(Of String) If r.rows(i).isnull("评委1") = False Then Names.Add("评委1") End If If r.rows(i).isnull("评委2") = False Then Names.Add("评委2") End If If r.rows(i).isnull("评委3") = False Then Names.Add("评委3") End If If r.rows(i).isnull("评委4") = False Then Names.Add("评委4") End If If r.rows(i).isnull("评委5") = False Then Names.Add("评委5") End If If r.rows(i).isnull("评委6") = False Then Names.Add("评委6") End If If r.rows(i).isnull("评委7") = False Then Names.Add("评委7") End If If r.rows(i).isnull("评委8") = False Then Names.Add("评委8") End If If r.rows(i).isnull("评委9") = False Then Names.Add("评委9") End If If r.rows(i).isnull("评委10") = False Then Names.Add("评委10") End If If r.rows(i).isnull("评委11") = False Then Names.Add("评委11") End If If r.rows(i).isnull("评委12") = False Then Names.Add("评委12") End If If r.rows(i).isnull("评委13") = False Then Names.Add("评委13") End If If r.rows(i).isnull("评委14") = False Then Names.Add("评委14") End If If r.rows(i).isnull("评委15") = False Then Names.Add("评委15") End If If r.rows(i).isnull("评委16") = False Then Names.Add("评委16") End If
r.Rows(i)("最大") = Functions.Execute("最大值",names) r.Rows(i)("最小") = Functions.Execute("最小值",names) Next 上述代码出错?
|