我是新來的Visual Studio.I試圖寫在Visual Basic中的一個簡單的程序,從一個文本框中取一個13位數字,並將其數字寫入一個數組。然後它寫入數組的第二個成員(數字的第二個數字)到另一個文本框,但它不起作用。這裏是代碼:Visual Basic(錯誤代碼)
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim array(12) As Integer
Dim index As Integer = 11
Dim code As Long = TextBox1.Text
Do While index >= 0
array(index) = code Mod 10
code /= 10
index -= 1
Loop
TextBox2.Text = array(1)
End Sub
End Class
你能告訴我什麼是錯的嗎?
忘了VB,但不是它:'code = code/10'和'index = index-1'。我也不會使用「數組」作爲名稱。 – 2013-03-08 08:34:25
Option Strict Off,這是最大的錯誤。 – Steve 2013-03-08 11:25:18