code得到跳跃时,我的程序加载 [英] Code gets skip when my program loads
问题描述
我使用Visual Studio和我有,我似乎无法找到任何解决的问题。在一个与我的程序的加载相关联的私有子,我必须以一个新的值在这两个二维阵列添加到第五点到REDIM两个不同的阵列。可悲的是,这似乎是我的程序跳过最后一个数组code没有理由。例如,该code仅REDIM的tbNoteIniGr2并跳过tbNoteIniGr1:
私人小组frmMain_Load(BYVAL发件人为System.Object的,BYVAL E上System.EventArgs)把手MyBase.Load
Me.Width = 380
使用ReDim preserve tbNoteIniGr2(tbNoteIniGr2.GetLength(0) - 1,tbNoteIniGr2.GetLength(1))
对于i = 0到tbNoteIniGr2.GetLength(0)
inNoteExamens1 = CINT(tbNoteIniGr2(I,1))+ CINT(tbNoteIniGr2(1,2))+ CINT(tbNoteIniGr2(I,4))
如果inNoteExamens1> = 45然后
inNoteFinale1 = inNoteExamens1 + CINT(tbNoteIniGr2(I,3))
其他
inNoteFinale1 = inNoteExamens1 + CINT(CINT(tbNoteIniGr2(I,3))* inNoteExamens1 / 75)
万一
tbNoteIniGr2(ⅰ,5)= inNoteFinale1
下一个 使用ReDim preserve tbNoteIniGr1(tbNoteIniGr1.GetLength(0) - 1,tbNoteIniGr1.GetLength(1))
对于i = 0到tbNoteIniGr1.GetLength(0)
inNoteExamens = CINT(tbNoteIniGr1(I,1))+ CINT(tbNoteIniGr1(1,2))+ CINT(tbNoteIniGr1(I,4))
如果inNoteExamens> = 45然后
inNoteFinale = inNoteExamens + CINT(tbNoteIniGr1(I,3))
其他
inNoteFinale = inNoteExamens + CINT(CINT(tbNoteIniGr1(I,3))* inNoteExamens / 75)
万一
tbNoteIniGr1(ⅰ,5)= inNoteFinale
下一个
结束小组
不同的是code这REDIM tbNoteIniGr1并跳过tbNoteIniGr2
私人小组frmMain_Load(BYVAL发件人为System.Object的,BYVAL E上System.EventArgs)把手MyBase.Load
Me.Width = 380使用ReDim preserve tbNoteIniGr1(tbNoteIniGr1.GetLength(0) - 1,tbNoteIniGr1.GetLength(1))
对于i = 0到tbNoteIniGr1.GetLength(0)
inNoteExamens = CINT(tbNoteIniGr1(I,1))+ CINT(tbNoteIniGr1(1,2))+ CINT(tbNoteIniGr1(I,4))
如果inNoteExamens> = 45然后
inNoteFinale = inNoteExamens + CINT(tbNoteIniGr1(I,3))
其他
inNoteFinale = inNoteExamens + CINT(CINT(tbNoteIniGr1(I,3))* inNoteExamens / 75)
万一
tbNoteIniGr1(ⅰ,5)= inNoteFinale
下一个使用ReDim preserve tbNoteIniGr2(tbNoteIniGr2.GetLength(0) - 1,tbNoteIniGr2.GetLength(1))
对于i = 0到tbNoteIniGr2.GetLength(0)
inNoteExamens1 = CINT(tbNoteIniGr2(I,1))+ CINT(tbNoteIniGr2(1,2))+ CINT(tbNoteIniGr2(I,4))
如果inNoteExamens1> = 45然后
inNoteFinale1 = inNoteExamens1 + CINT(tbNoteIniGr2(I,3))
其他
inNoteFinale1 = inNoteExamens1 + CINT(CINT(tbNoteIniGr2(I,3))* inNoteExamens1 / 75)
万一
tbNoteIniGr2(ⅰ,5)= inNoteFinale1
下一个
结束小组
我用的是一步一步的调试和它只是跳过的最后一部分,所以我很困惑。哦,顺便说一句,这是我的变量
暗淡tbNoteIniGr1(,)作为字符串= {{让Narrace,16,8,13,10},{楚Paspire 20,20,23,24},{Yésuis芭菲,25,25,25,25},
{Moyende Moyenner,20,18,20,12},{IA Rienla,19,24,21,22},{中卫Troisième ,21,22,24,24},
{佩佩Lacasse,21,21,21,11},{Jvatu Couler,19,18,14,10},{Ungars Sessaye ,0,0,0,25},
{Mpassetu Tonlab,10,10,25,10},{卡瓦Mieux,10,15,20,25},{QuéyéSuisbonnw ,24,24,24,24},
{性感身材,24,6,15,24},{伊冯·Meravoir,12,11,18,15},{Jeannez Assez ,25,15,5,0},
{Téreize博登,13,13,13,13},{DéhautEtdébas,20,5,25,9},{Jpasse Saligne ,13,17,14,16},
{Passez Moidonc,18,17,13,10}}
暗淡tbNoteIniGr2(,)作为字符串= {{吕西安娜维埃纳省,16,24,19,21},{阿道夫Kirpoupov,20,20,23, 24},{Miville圣罗氏,20,18,20,12},
{Gastonne罗雄,19,24,21,22},{吕克Delaqueduc,24,16,15,24},{拉斐尔Angelie ,21,18,15,20}}
暗淡inNoteExamens,inNoteFinale,inEchec,inNoteExamens1,inNoteFinale1,inNombreEtudiant,inTotal作为整数
昏暗stChaine作为字符串
编辑:这里就是整个code
公共类frmMain
暗淡tbNoteIniGr1(,)作为字符串= {{让Narrace,16,8,13,10},{楚Paspire,20,20,23, 24},{Yésuis芭菲,25,25,25,25},
{Moyende Moyenner,20,18,20,12},{IA Rienla,19,24,21,22},{中卫Troisième ,21,22,24,24},
{佩佩Lacasse,21,21,21,11},{Jvatu Couler,19,18,14,10},{Ungars Sessaye ,0,0,0,25},
{Mpassetu Tonlab,10,10,25,10},{卡瓦Mieux,10,15,20,25},{QuéyéSuisbonnw ,24,24,24,24},
{性感身材,24,6,15,24},{伊冯·Meravoir,12,11,18,15},{Jeannez Assez ,25,15,5,0},
{Téreize博登,13,13,13,13},{DéhautEtdébas,20,5,25,9},{Jpasse Saligne ,13,17,14,16},
{Passez Moidonc,18,17,13,10}}
暗淡tbNoteIniGr2(,)作为字符串= {{吕西安娜维埃纳省,16,24,19,21},{阿道夫Kirpoupov,20,20,23, 24},{Miville圣罗氏,20,18,20,12},
{Gastonne罗雄,19,24,21,22},{吕克Delaqueduc,24,16,15,24},{拉斐尔Angelie ,21,18,15,20}}
暗淡inNoteExamens,inNoteFinale,inEchec,inNoteExamens1,inNoteFinale1,inNombreEtudiant,inTotal作为整数
昏暗stChaine作为字符串 私人小组frmMain_Load(BYVAL发件人为System.Object的,BYVAL E上System.EventArgs)把手MyBase.Load
Me.Width = 380 使用ReDim preserve tbNoteIniGr1(tbNoteIniGr1.GetLength(0) - 1,tbNoteIniGr1.GetLength(1))
对于i = 0到tbNoteIniGr1.GetLength(0)
inNoteExamens = CINT(tbNoteIniGr1(I,1))+ CINT(tbNoteIniGr1(1,2))+ CINT(tbNoteIniGr1(I,4))
如果inNoteExamens> = 45然后
inNoteFinale = inNoteExamens + CINT(tbNoteIniGr1(I,3))
其他
inNoteFinale = inNoteExamens + CINT(CINT(tbNoteIniGr1(I,3))* inNoteExamens / 75)
万一
tbNoteIniGr1(ⅰ,5)= inNoteFinale
下一个 使用ReDim preserve tbNoteIniGr2(tbNoteIniGr2.GetLength(0) - 1,tbNoteIniGr2.GetLength(1))
对于i = 0到tbNoteIniGr2.GetLength(0)
inNoteExamens1 = CINT(tbNoteIniGr2(I,1))+ CINT(tbNoteIniGr2(1,2))+ CINT(tbNoteIniGr2(I,4))
如果inNoteExamens1> = 45然后
inNoteFinale1 = inNoteExamens1 + CINT(tbNoteIniGr2(I,3))
其他
inNoteFinale1 = inNoteExamens1 + CINT(CINT(tbNoteIniGr2(I,3))* inNoteExamens1 / 75)
万一
tbNoteIniGr2(ⅰ,5)= inNoteFinale1
下一个
结束小组 私人小组btnNoteGr1_Click(BYVAL发件人为System.Object的,BYVAL E上System.EventArgs)把手btnNoteGr1.Click
rtbText.Location =新点(98,13)
gbxStats.Location =新点(466.13) inEchec = 0
stChaine =
stChaine =说明终曲倒乐GROUPE 01&放大器; vbCrLf&安培; 赛道420-246&放大器; vbCrLf&安培; 会话HIVER 2011&放大器;
vbCrLf&安培; vbCrLf&安培; 喃&放大器;空间(20)及NoteF与& vbCrLf&安培; vbCrLf
对于i = 0到tbNoteIniGr1.GetLength(0) - 1
stChaine&放大器; = tbNoteIniGr1(I,0)及空间(25 - tbNoteIniGr1(I,0)。长度)及tbNoteIniGr1(ⅰ,5).PadLeft(3)及vbCrLf
如果tbNoteIniGr1(ⅰ,5)所述; 60然后
inEchec + = 1
万一
下一个
rtbText.Text = stChaine
tbxEhcas.Text = CStr的(inEchec)
结束小组 私人小组btnNoteGr2_Click(BYVAL发件人为System.Object的,BYVAL E上System.EventArgs)把手btnNoteGr2.Click
rtbText.Location =新点(98,13)
gbxStats.Location =新点(466.13) inEchec = 0
stChaine =
stChaine =说明终曲倒乐GROUPE 02&放大器; vbCrLf&安培; 赛道420-246&放大器; vbCrLf&安培; 会话HIVER 2011&放大器;
vbCrLf&安培; vbCrLf&安培; 喃&放大器;空间(20)及NoteF与& vbCrLf&安培; vbCrLf
对于i = 0到tbNoteIniGr2.GetLength(0) - 1
stChaine&放大器; = tbNoteIniGr2(I,0)及空间(25 - tbNoteIniGr2(I,0)。长度)及tbNoteIniGr2(ⅰ,4).PadLeft(3)及vbCrLf
如果tbNoteIniGr2(ⅰ,5)所述; 60然后
inEchec + = 1
万一
下一个
rtbText.Text = stChaine
tbxEhcas.Text = CStr的(inEchec)
结束小组 私人小组btnStatGr1_Click(BYVAL发件人为System.Object的,BYVAL E上System.EventArgs)把手btnStatGr1.Click
rtbText.Location =新点(466.13)
gbxStats.Location =新点(98,13) inTotal = 0
inNombreEtudiant = 0
inEchec = 0 对于i = 0到tbNoteIniGr1.GetLength(0) - 1
inNombreEtudiant + = 1
inTotal + = CINT(tbNoteIniGr1(I,5))
如果tbNoteIniGr1(ⅰ,5)所述; 60然后
inEchec + = 1
万一
下一个 tbxGroupe.Text =01
tbxMoyenne.Text = inTotal / inNombreEtudiant
tbxNombreEchec.Text = inEchec
tbxNombreEtudiant.Text = inNombreEtudiant
结束小组 私人小组btnStatGr2_Click(BYVAL发件人为System.Object的,BYVAL E上System.EventArgs)把手btnStatGr2.Click
rtbText.Location =新点(466.13)
gbxStats.Location =新点(98,13) inTotal = 0
inNombreEtudiant = 0
inEchec = 0 对于i = 0到tbNoteIniGr2.GetLength(0) - 1
inNombreEtudiant + = 1
inTotal + = CINT(tbNoteIniGr2(I,5))
如果tbNoteIniGr2(ⅰ,5)所述; 60然后
inEchec + = 1
万一
下一个 tbxGroupe.Text =02
tbxMoyenne.Text = inTotal / inNombreEtudiant
tbxNombreEchec.Text = inEchec
tbxNombreEtudiant.Text = inNombreEtudiant
结束小组
末级
从MSDN:
以preserve 调整。如果您使用 preserve ,您可以调整阵列的只有最后一个维度即可。对于每一个其它维度,必须指定绑定现有阵列。
例如,如果你的数组只有一个尺寸,可以调整该维度,仍然preserve阵列中的所有内容,因为你正在改变最后的也是唯一的维度。但是,如果你的数组有两个或多个维度,您便可以使用 preserve只改变最后一维的大小。的
瓦尔特
I'm using Visual Studio and I'm having a problem that I can't seem to find any solution. In the private sub that's associated with the loading of my program, I have to redim two different arrays in order to add a new value to the fifth spot in these two 2d arrays. Sadly, it seems like my program skips the last array code for no reason. For example, this code only redim the tbNoteIniGr2 and skip tbNoteIniGr1:
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Width = 380
ReDim Preserve tbNoteIniGr2(tbNoteIniGr2.GetLength(0) - 1, tbNoteIniGr2.GetLength(1))
For i = 0 To tbNoteIniGr2.GetLength(0)
inNoteExamens1 = CInt(tbNoteIniGr2(i, 1)) + CInt(tbNoteIniGr2(i, 2)) + CInt(tbNoteIniGr2(i, 4))
If inNoteExamens1 >= 45 Then
inNoteFinale1 = inNoteExamens1 + CInt(tbNoteIniGr2(i, 3))
Else
inNoteFinale1 = inNoteExamens1 + CInt(CInt(tbNoteIniGr2(i, 3)) * inNoteExamens1 / 75)
End If
tbNoteIniGr2(i, 5) = inNoteFinale1
Next
ReDim Preserve tbNoteIniGr1(tbNoteIniGr1.GetLength(0) - 1, tbNoteIniGr1.GetLength(1))
For i = 0 To tbNoteIniGr1.GetLength(0)
inNoteExamens = CInt(tbNoteIniGr1(i, 1)) + CInt(tbNoteIniGr1(i, 2)) + CInt(tbNoteIniGr1(i, 4))
If inNoteExamens >= 45 Then
inNoteFinale = inNoteExamens + CInt(tbNoteIniGr1(i, 3))
Else
inNoteFinale = inNoteExamens + CInt(CInt(tbNoteIniGr1(i, 3)) * inNoteExamens / 75)
End If
tbNoteIniGr1(i, 5) = inNoteFinale
Next
End Sub
Unlike this code which redim tbNoteIniGr1 and skips tbNoteIniGr2
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Width = 380
ReDim Preserve tbNoteIniGr1(tbNoteIniGr1.GetLength(0) - 1, tbNoteIniGr1.GetLength(1))
For i = 0 To tbNoteIniGr1.GetLength(0)
inNoteExamens = CInt(tbNoteIniGr1(i, 1)) + CInt(tbNoteIniGr1(i, 2)) + CInt(tbNoteIniGr1(i, 4))
If inNoteExamens >= 45 Then
inNoteFinale = inNoteExamens + CInt(tbNoteIniGr1(i, 3))
Else
inNoteFinale = inNoteExamens + CInt(CInt(tbNoteIniGr1(i, 3)) * inNoteExamens / 75)
End If
tbNoteIniGr1(i, 5) = inNoteFinale
Next
ReDim Preserve tbNoteIniGr2(tbNoteIniGr2.GetLength(0) - 1, tbNoteIniGr2.GetLength(1))
For i = 0 To tbNoteIniGr2.GetLength(0)
inNoteExamens1 = CInt(tbNoteIniGr2(i, 1)) + CInt(tbNoteIniGr2(i, 2)) + CInt(tbNoteIniGr2(i, 4))
If inNoteExamens1 >= 45 Then
inNoteFinale1 = inNoteExamens1 + CInt(tbNoteIniGr2(i, 3))
Else
inNoteFinale1 = inNoteExamens1 + CInt(CInt(tbNoteIniGr2(i, 3)) * inNoteExamens1 / 75)
End If
tbNoteIniGr2(i, 5) = inNoteFinale1
Next
End Sub I use the step-by-step debugging and it simply skips the last part so I'm confused. Oh and by the way, these are my variables
Dim tbNoteIniGr1(,) As String = {{"Jean Narrace", "16", "8", "13", "10"}, {"Chu Paspire", "20", "20", "23", "24"}, {"Yésuis Parfait", "25", "25", "25", "25"},
{"Moyende Moyenner", "20", "18", "20", "12"}, {"Ia Rienla", "19", "24", "21", "22"}, {"Chue Troisième", "21", "22", "24", "24"},
{"Pépé Lacasse", "21", "21", "21", "11"}, {"Jvatu Couler", "19", "18", "14", "10"}, {"Ungars Sessaye", "0", "0", "0", "25"},
{"Mpassetu Tonlab", "10", "10", "25", "10"}, {"Cava Mieux", "10", "15", "20", "25"}, {"Quéyé Suisbonnw", "24", "24", "24", "24"},
{"Sexy Body", "24", "6", "15", "24"}, {"Yvon Meravoir", "12", "11", "18", "15"}, {"Jeannez Assez", "25", "15", "5", "0"},
{"Téreize Constance", "13", "13", "13", "13"}, {"Déhaut Etdébas", "20", "5", "25", "9"}, {"Jpasse Saligne", "13", "17", "14", "16"},
{"Passez Moidonc", "18", "17", "13", "10"}}
Dim tbNoteIniGr2(,) As String = {{"Lucienne Vienne", "16", "24", "19", "21"}, {"Adolf Kirpoupov", "20", "20", "23", "24"}, {"Miville St-Roche", "20", "18", "20", "12"},
{"Gastonne Rochon", "19", "24", "21", "22"}, {"Luc Delaqueduc", "24", "16", "15", "24"}, {"Raphael Angelie", "21", "18", "15", "20"}}
Dim inNoteExamens, inNoteFinale, inEchec, inNoteExamens1, inNoteFinale1, inNombreEtudiant, inTotal As Integer
Dim stChaine As String
EDIT: HERE'S THE ENTIRE CODE
Public Class frmMain
Dim tbNoteIniGr1(,) As String = {{"Jean Narrace", "16", "8", "13", "10"}, {"Chu Paspire", "20", "20", "23", "24"}, {"Yésuis Parfait", "25", "25", "25", "25"},
{"Moyende Moyenner", "20", "18", "20", "12"}, {"Ia Rienla", "19", "24", "21", "22"}, {"Chue Troisième", "21", "22", "24", "24"},
{"Pépé Lacasse", "21", "21", "21", "11"}, {"Jvatu Couler", "19", "18", "14", "10"}, {"Ungars Sessaye", "0", "0", "0", "25"},
{"Mpassetu Tonlab", "10", "10", "25", "10"}, {"Cava Mieux", "10", "15", "20", "25"}, {"Quéyé Suisbonnw", "24", "24", "24", "24"},
{"Sexy Body", "24", "6", "15", "24"}, {"Yvon Meravoir", "12", "11", "18", "15"}, {"Jeannez Assez", "25", "15", "5", "0"},
{"Téreize Constance", "13", "13", "13", "13"}, {"Déhaut Etdébas", "20", "5", "25", "9"}, {"Jpasse Saligne", "13", "17", "14", "16"},
{"Passez Moidonc", "18", "17", "13", "10"}}
Dim tbNoteIniGr2(,) As String = {{"Lucienne Vienne", "16", "24", "19", "21"}, {"Adolf Kirpoupov", "20", "20", "23", "24"}, {"Miville St-Roche", "20", "18", "20", "12"},
{"Gastonne Rochon", "19", "24", "21", "22"}, {"Luc Delaqueduc", "24", "16", "15", "24"}, {"Raphael Angelie", "21", "18", "15", "20"}}
Dim inNoteExamens, inNoteFinale, inEchec, inNoteExamens1, inNoteFinale1, inNombreEtudiant, inTotal As Integer
Dim stChaine As String
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Width = 380
ReDim Preserve tbNoteIniGr1(tbNoteIniGr1.GetLength(0) - 1, tbNoteIniGr1.GetLength(1))
For i = 0 To tbNoteIniGr1.GetLength(0)
inNoteExamens = CInt(tbNoteIniGr1(i, 1)) + CInt(tbNoteIniGr1(i, 2)) + CInt(tbNoteIniGr1(i, 4))
If inNoteExamens >= 45 Then
inNoteFinale = inNoteExamens + CInt(tbNoteIniGr1(i, 3))
Else
inNoteFinale = inNoteExamens + CInt(CInt(tbNoteIniGr1(i, 3)) * inNoteExamens / 75)
End If
tbNoteIniGr1(i, 5) = inNoteFinale
Next
ReDim Preserve tbNoteIniGr2(tbNoteIniGr2.GetLength(0) - 1, tbNoteIniGr2.GetLength(1))
For i = 0 To tbNoteIniGr2.GetLength(0)
inNoteExamens1 = CInt(tbNoteIniGr2(i, 1)) + CInt(tbNoteIniGr2(i, 2)) + CInt(tbNoteIniGr2(i, 4))
If inNoteExamens1 >= 45 Then
inNoteFinale1 = inNoteExamens1 + CInt(tbNoteIniGr2(i, 3))
Else
inNoteFinale1 = inNoteExamens1 + CInt(CInt(tbNoteIniGr2(i, 3)) * inNoteExamens1 / 75)
End If
tbNoteIniGr2(i, 5) = inNoteFinale1
Next
End Sub
Private Sub btnNoteGr1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNoteGr1.Click
rtbText.Location = New Point(98, 13)
gbxStats.Location = New Point(466.13)
inEchec = 0
stChaine = ""
stChaine = "Notes finales pour le groupe 01" & vbCrLf & "Cours 420-246" & vbCrLf & "Session Hiver 2011" &
vbCrLf & vbCrLf & "Nom" & Space(20) & "NoteF" & vbCrLf & vbCrLf
For i = 0 To tbNoteIniGr1.GetLength(0) - 1
stChaine &= tbNoteIniGr1(i, 0) & Space(25 - tbNoteIniGr1(i, 0).Length) & tbNoteIniGr1(i, 5).PadLeft(3) & vbCrLf
If tbNoteIniGr1(i, 5) < 60 Then
inEchec += 1
End If
Next
rtbText.Text = stChaine
tbxEhcas.Text = CStr(inEchec)
End Sub
Private Sub btnNoteGr2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNoteGr2.Click
rtbText.Location = New Point(98, 13)
gbxStats.Location = New Point(466.13)
inEchec = 0
stChaine = ""
stChaine = "Notes finales pour le groupe 02" & vbCrLf & "Cours 420-246" & vbCrLf & "Session Hiver 2011" &
vbCrLf & vbCrLf & "Nom" & Space(20) & "NoteF" & vbCrLf & vbCrLf
For i = 0 To tbNoteIniGr2.GetLength(0) - 1
stChaine &= tbNoteIniGr2(i, 0) & Space(25 - tbNoteIniGr2(i, 0).Length) & tbNoteIniGr2(i, 4).PadLeft(3) & vbCrLf
If tbNoteIniGr2(i, 5) < 60 Then
inEchec += 1
End If
Next
rtbText.Text = stChaine
tbxEhcas.Text = CStr(inEchec)
End Sub
Private Sub btnStatGr1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStatGr1.Click
rtbText.Location = New Point(466.13)
gbxStats.Location = New Point(98, 13)
inTotal = 0
inNombreEtudiant = 0
inEchec = 0
For i = 0 To tbNoteIniGr1.GetLength(0) - 1
inNombreEtudiant += 1
inTotal += CInt(tbNoteIniGr1(i, 5))
If tbNoteIniGr1(i, 5) < 60 Then
inEchec += 1
End If
Next
tbxGroupe.Text = "01"
tbxMoyenne.Text = inTotal / inNombreEtudiant
tbxNombreEchec.Text = inEchec
tbxNombreEtudiant.Text = inNombreEtudiant
End Sub
Private Sub btnStatGr2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStatGr2.Click
rtbText.Location = New Point(466.13)
gbxStats.Location = New Point(98, 13)
inTotal = 0
inNombreEtudiant = 0
inEchec = 0
For i = 0 To tbNoteIniGr2.GetLength(0) - 1
inNombreEtudiant += 1
inTotal += CInt(tbNoteIniGr2(i, 5))
If tbNoteIniGr2(i, 5) < 60 Then
inEchec += 1
End If
Next
tbxGroupe.Text = "02"
tbxMoyenne.Text = inTotal / inNombreEtudiant
tbxNombreEchec.Text = inEchec
tbxNombreEtudiant.Text = inNombreEtudiant
End Sub
End Class
From MSDN:
Resizing with Preserve. If you use Preserve, you can resize only the last dimension of the array. For every other dimension, you must specify the bound of the existing array. For example, if your array has only one dimension, you can resize that dimension and still preserve all the contents of the array, because you are changing the last and only dimension. However, if your array has two or more dimensions, you can change the size of only the last dimension if you use Preserve.
valter
这篇关于code得到跳跃时,我的程序加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!