版主帮忙看看,是书上的例题可总是出错?
Type recordtel num As Integer name As String tel As String End Type Option Base 1 Public stud() As recordtel Public n As Integer
Private Sub Form_Click() n = InputBox("请输入数据") n = CInt(n) ReDim stud(n) As recordtel Open "e:\in.txt" For Append As #1 For i = 1 To n stud(i).num = InputBox("请输入号码") ststud(i).name = InputBox("请输入姓名") stud(i).tel = InputBox("请输入电话号码") Write #1, stud(i).num, stud(i).name, stud(i).tel Next i Close #1 End Sub 提示是:编译错误 常数,固定长度字符串,数组,用户定义类型以及DECLARE语句不允许作为对象模块的public成员 可是刘炳文的书上是这样写的呀,我没抄错哦! 不过把public stud() as recordtel 改在Private Sub Form_Click()下面又好了 static stud() as recordtel 不知为何,请指教??? 谢了!