窗体上有一个名称为Command1的命令按钮,一个名称为List1的列表框。命令按钮的单击事件过程如下: Private Sub Command1_Click() Open "c:f1.txt" For Input As #1 Do While Not EOF(1) Input #1, str1 List1.AddItem str1 Loop Close End Sub 对于上述程序,以下叙述中错误的是________。A.Close的作用是关闭已经打开的数据文件B.单击命令按钮后,把f1.txt中的所有内容添加到列表框中C.以输入方式打开随机文件f1.txtD.运行程序后,列表框中的列表项都是f1.txt中的记录

窗体上有一个名称为Command1的命令按钮,一个名称为List1的列表框。命令按钮的单击事件过程如下: Private Sub Command1_Click() Open "c:f1.txt" For Input As #1 Do While Not EOF(1) Input #1, str1 List1.AddItem str1 Loop Close End Sub 对于上述程序,以下叙述中错误的是________。

A.Close的作用是关闭已经打开的数据文件

B.单击命令按钮后,把f1.txt中的所有内容添加到列表框中

C.以输入方式打开随机文件f1.txt

D.运行程序后,列表框中的列表项都是f1.txt中的记录


参考答案和解析
C C。【解析】本题考y,-add方法里IsMissing的v3,v3是一个可选项,用来判断这个参数是否存在。根据程序语句,当输入3个参数时,就是3个参数求和,输入2个参数时是两个数求和,题目中是2个参数,因此是2个参数求和,不会报错。

相关考题:

窗体上有一个名称为Text1的文本框和—个名称为Command1的命令按钮。要求程序运行时,单击命令按钮,就可把文本框中的内容写到文件out.txt中,每次写入的内容附加到原有内容之后。下面能够正确实现上述功能的程序是______。A.Private Sub Command1_Click() Open "out.txt" For Input As#1 Print #1,Text1.Text Close #1 End SubB.Private Sub Command1_Click() Open "out.txt" For Output AS #1 Print #1,Text1.Text Close #1 End SubC.Private Sub Command1_Click() Open "out.txt" For Append As #1 Print #1,Text1.Text Close #1 End SubD.Private Sub Command1_Click() Open "out.txt" For Random As #1 Print #1,Text1.Text Close #1 End Sub

在窗件上画一个命令按钮,其名称为Command1,然后编写如下事件过程: Private Sub Command1_Click() a=12345 Print Format S(a, "000. 00") End Sub 程序运行后,单击命令按钮,窗体上显示的是______。A.123.45B.12345.00C.12345D.00123.45

在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() a S="VisualBasic" Print String(3, a$) End Sub 程序运行后,单击命令按钮,在窗体上显示的内容是______。A.VVVB.VisC.sicD.11

在窗体中添加一个命令按钮(名为Command1) 和一个文本框(名为Text1) ,并在命令按钮中编写如下事例代码: Private Sub Command1_Click( ) Str1="981765" Str2="65" n=InStr(Str1,Str2) Me.Text1=n End Sub 窗体打开运行后,单击命令按钮,在文本框中显示______。A.4B.5C.6D.7

在窗体上画一个命令按钮,然后编写如下代码: Private Type Record ID As Integer Name As String *20 End Type Private Sub Command1_Click() Dim Maxsize, NextChar, MyChar Open "d:\temp\female.txt" For Input As #1 Maxsize = LOF(1) For NextChar = Maxsize To 1 Step -1 Seek #1, NextChar MyChar = Input(1, #1) Next NextChar Print EOF(I) Close 31 End Sub 程序运行后,单击命令按钮,其输出的结果为A.TrueB.FalseC.0D.Null

如下图所示的两个窗体:要使其中第一个窗体中的第一个命令按钮来控制显示第二个窗体,第二个命令按钮用来结束程序的运行(两个按钮名称为Command1和Command2)。则以下选项中,对这两个命令按钮编写的事件过程正确的是A.Private Sub Command1 Click() Form2.Show 1 End Sub Private Sub Command2_Click()End End SubB.Private Sub Command1_Click() Show 1 End Sub Private Sub Conunand2_Click() End End SubC.Private Sub Conmmand1_Click() Show 1 End Sub Private Sub Command2_Click() End End SubD.Private Sub Command1_Click()Show 1, Form2 End SubPrivate Sub Command2_Click() End End Sub

窗体Form1上有一个名称为Command1的命令按钮,以下对应窗体单击事件的事件过程是( )。A.Private Sub Form1 Click( )End Sub···B.Private Sub Form1. Click( )End Sub···C.Private Sub Command1 click( )End Sub···D.Private Sub Command Click( )End Sub···

在窗体上画—个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim num As Integer num=1 Do Until num>6 Print num; num=num+4 Loop End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是_________。A.13.45.8B.1 3 5C.147D.无数据输出

在窗体上画一个命令按钮(名称为Command1),然后编写如下事件过程: Private Sub Command1_Click() Dim b As Integer b=b+1 End Sub 运行程序,三次单击命令按钮后,变量b的值是: ______。A.0B.1C.2D.3

在窗体上画一个命令按钮(名称为Command1),编写如下事件过程: Private Sub Command1_Click() b=5 c=6 Print a=b+c End Sub 程序运行后,单击命令按钮,输出的结果是: ______。A.a=11B.a=b+cC.a=D.假

在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim num As Integer num=1 Do UntiL num>6 Print num; num=num+2.4 Loop End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是 ______。A.13.45.8B.1 3 5C.1 4 7D.无数据输出

在窗体上画一今名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim a As Integer,s As Integer a=8 s=1 Do s=s+a a=a-1 Loop While a<=0 Print s;a End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是 ______。A.79B.340C.97D.死循环

在窗体上画一个命令按钮,其名称为Command1,然后编写如下事件过程: Private Sub Command1_Click( ) a=12345 Print Format $(a,"000.00") End Sub 程序运行后,单击命令按钮,窗体上显示的是A.123.45B.12345.00C.12345D.00123.45

在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim a As Integer,s As Integer a = 8 s = 1 Do s = s + a a = a - 1 Loop While a<=0 Print s,a End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是A.7 9B.34 0C.9D.死循环

在窗体上画一个命令按钮,然后编写如下代码: Private Type Record ID As Integer Name As String * 20 End Type Private Sub Command1_Click( ) Dim MaxSize, NextChar, MyChar Open "d:\vb\tt. txt" For Input As #1 MaxSize = LOF(1) For NextChar = MaxSize To 1 Step - 1 Seek # 1, NextChar MyChar = Input(1, # 1) Next NextChar Print EOF(1) Close $1 End Sub 假设文件d:\vb\tt. txt 的内容为 Hello eveybody! 那么程序运行后,单击命令按钮,其输出结果为 ______。A.TrueB.FalseC.0D.Null

在窗体上画一个命令按钮,然后编写如下代码: Private Type Record ID As Integer Name As String*20 End Type Private Sub Command1_Click() Dim MaxSize.NextChar,MyChar Open"D:\temp\female.txt"For Input As #1 MaxSize=LOF(1) For NextChar=1 To MaxSize Seek#1,NextChar MyChar=Input(1,#1) Next NextChar Print EOF(1) Close #1 End Sub 程序运行后,单击命令按钮,其输出结果为 ______。A.TrueB.FalseC.0D.Null

在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Call sub1(-15.1,2.54) End Sub Public Function sub1(a As Integer,ByVa1 b As String) As Integer a=Val(B)sub1=a Print sub1 End Function 程序运行后,单击命令按钮,在窗体上输出的是A.3B.2C.-15D.提示出错

在窗体上画一个命令按钮,名称为Command1,然后编写如下事件过程:Private Sub Command1_Cilck()End Sub运行程序,单击命令按钮,则在弹出的信息框的标题栏中显示的是( )。

窗体上有一个名称为Command1的命令按钮,并有如下程序: Private Sub Command1 Click( ) x=14 Do While x0 x=x-3 x=IIf(Int(x/5)=x/5,x+2,x) Loop Print x End Sub 程序运行后,单击命令按钮Command1,输出结果为( )。A.0B.-lC.-2D.-_3

在窗体上画一个命令按钮,其名称为Command1,然后编写如下事件过程: Private Sub Command1_Click() a = 12345 Print Format$(a, "000.00") End Sub 程序运行后,单击命令按钮,窗体上显示的是A. 123.45B.12345.00C.12345D.00123.45

在窗体上画—个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim num As Integer num=1 DO Until num>6 Print num; num=num+2.4 Loop End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是 ______。A.13.45.8B.1 3 5C.1 4 7D.无数据输出

在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub sub1(ByVal x As Integer, ByVal y As Integer, ByVal z As Integer) z=x * x+ y * y End Sub Private Sub Command1_Click() Dim a As Integer a = 8 Call sub1(1, 2,A)Print a End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是A.8B.2C.5D.11

在窗体上画一个命令按钮,名称为Command1。然后编写如下程序: Private Sub Command1_Click() Dim i As Integer,a As Integer Do While i<20 Do While True If i Mod 10=0 Then Exit Do Else i=i-1 End If Loop i=i+11 a=a+i Loop Printa End Sub程序运行后,如果单击命令按钮,则在窗体上显示的内容是( )。A.21B.32C.33D.11

在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Privme Sub Command1_Click( ) a$="VisualBasic" Print String(3,a$) End Sub 程序运行后,单击命令按钮,在窗体上显示的内容是A.VVVB.VisC.sicD.11

在窗体上画一个命令按钮,名称为Command1。然后编写如下程序: Private Sub Command1_Click() Dim j As Integer,s As Integer s=1 Do s=s+j j=j+1 Loop Until j>=5 Print s End Sub 程序运行后,单击命令按钮,在窗体上输出的结果是( )。A.11B.1C.16D.7

在窗体上面一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim a As Integer, s As Integer a=8 s=1 Do s=s+a a=a-1 Loop While a<=0 Print s; a End Sub 程序运行后,单击命令按钮.则窗体上显示的内容是______。A.7 9B.34 0C.9 7D.死循环

窗体上画一个命令按钮,然后编写如下代码:Private Type Record ID As Integer Name As String * 20End TypePrivate Sub command1 _ Click( Open "c: \file. txt" for Input As MaxSize = LOF (1) for NextChar =MaxSize To Step-1 Seek #1, NextChar MyChar=Input(1,#1) Next NextChar Print EOF(1) Close #1 End Sub程序运行后,单击命令按钮,其输出结果为______。A.TrueB.FalseC.0D.Null

在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程:Private Sub Command1_Click()x = -5If Sgn(x) Then y = Sgn(x ^ 2)Else y = Sgn(x)End IfPrint yEnd Sub程序运行后,单击命令按钮,窗体上显示的是( )。A.-5B.25C.1D.-1