谢谢楼上诸位的关注!
学了C语言后就觉得VB的语句忒啰嗦。
我最近学习线性代数,同学们苦于矩阵运算的麻烦,希望我给他们做一个程序。
我现在用最土得办法——把行列式展开成代数式求解,这居然还卡壳!
Private Sub cmda_Click()
Dim a11 As Integer, a12 As Integer, a13 As Integer
Dim a21 As Integer, a22 As Integer, a23 As Integer
Dim a31 As Integer, a32 As Integer, a33 As Integer
Dim dta As Integer
a11 = Val(a11.Text): a12 = Val(a12.Text): a13 = Val(a13.Text)
a21 = Val(a21.Text): a22 = Val(a22.Text): a23 = Val(a23.Text)
a31 = Val(a31.Text): a32 = Val(a32.Text): a33 = Val(a33.Text)
dta = (a11 * a22 * a33) + (a12 * a23 * a31) + (a21 * a32 * a13) - (a31 * a22 * a13) - (a21 * a12 * a33) - (a32 * a23 * a11)
dta.Text = Str(dta)
End Sub
在运行这段语句的时候,卡在a11 = Val(a11.Text): 这里了。说什么“编译错误,无效限定符”。
控件的名字弄得跟变量一样要紧吗?