0
我有一個數組填充了24個數字我想所有的數字要加在一起,然後顯示在文本框中。這是我爲這個數組創建的代碼。但我不確定如何將數組中的所有數字一起添加。感謝您的時間。在數組中添加所有數字
'Calculating distances
Dim Game As String
Game = txtGameAdd.Text
SystemValueGame = SystemValueGame + 1
TotalGames(SystemValueGame) = Game
txtGameAdd.Text = ""
txtGameAdd.Focus()
'Keeping count with lables'
lblAmountNum.Text = SystemValueGame
'Double Checking SystemValue'
If SystemValueGame = 24 Then
'notify when array is full'
MsgBox("Entered Max Amount Of Surnames", MsgBoxStyle.Information)
txtGameAdd.Text = " "
txtGameAdd.Enabled = False
End If
嘗試使用[For Each](https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/for-each-next-statement) –
什麼是數組? – ZAhmed
該數組是TotalGames – jdavies