A.Private Sub save Click()
Text1.Text=file.save.Caption
End Sub
B.Private Sub save Click()
Text1.Text=save.Caption
End Sub
C.Private Sub file Click()
Text1.Text=file.save.Caption
End Sub
D.Private Sub file Click()
Text1.Text=save.Caption
End Sub
28.在窗体上有两个名称分别为Text1、Text2的文本框,一个名称为Command1的命令按钮,运行后的窗体外观如图所示:
设有如下的类型和变量声明:
Private Type Person
name As STRING*8
major As String*20
End Type
Dim P As Person
设文本框中的数据已正确地赋值给Person类型的变量P,当点击“保存”按钮时,能够
正确地把变量中的数据写入随机文件Test2.dat中的程序段是( )。
A.Open"C:\Test2.dat"For Output As#1
Put#1,1,p
Close#1
B.0pen"c:\Test2.dat"For Random As#1
Get#1,1,P
Close#1
C.Open”C:\Test2.dat”For Random As#1 Len—Len(p)
Put#1,1,P
Close#1
D.Open"C:\Test2.dat"For Random As#1 Len=Len(p)
Get#1,1,P
Close#1
29.以下叙述中错误的是( )。
A.一个工程中可以包含多个窗体文件
B.在一个窗体文件中用Private定义的通用过程能被其他窗体调用
C.在设计Visual Basic程序时,窗体、标准模块、类模块等需要分别保存为不同类型的磁盘文件
D.全局变量必须在标准模块中定义
30.Sub过程与Function过程最根本的区别是( )。
A.Sub过程可以用Call语句直接使用过程名调用,而Function过程不可以
B.Function过程可以有形参,Sub过程不可以
C.Sub过程不能返回值,而Function过程能返回值
D.两种过程参数的传递方式不同