在窗体上画一个命令按钮,然后编写如下代码: 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
在窗体上画一个命令按钮,然后编写如下代码: 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.True
B.False
C.0
D.Null
相关考题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub subl(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 subl(1, 2,a) Print a End Sub 程序运行后,单击命令按钮,则窗体下显示的内容是______。A.8B.2C.5D.11
设在工程中有一个标准模块,其中定义了如下记录类型 Type Books Name As String*10 TelNum As String*20 End Type 在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1_Click时, 在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是 ______。A.Private Sub Command1_Click() Dim B As Books Open "c:\Person.txt"For Output As #1 B.Name=InputBox("输入姓名") B.TelNum=InputBox("输入电话号码") Write #1,B.Name,B.TelNum Close #1 End SubB.Private Sub Command1_Click() Dim B As Books Open"c:\Person.txt" For Input As #1 B.Name=InputBox("输入姓名") B.TelNum=InputBox("输入电话号码") Print #1,B.Name,B.TelNum Close #1 End SubC.Private Sub Command1_Click() Dim B As Books Open"c:\Person.txt"For Output As #1 B.Name=InputBox("输入姓名") B.TelNum=InputBox("输入电话号码") Write#1,B Close #1 End SubD.Private Sub Command1_Click() Dim B As Books Open"c:\Person.txt"For Input As #1 Name=InputBox("输入姓名") TelNum=InputBox("输入电话号码") Print#1,Name,TelNum Close #1 End Sub
( 35 )设在工程文件中有一个标准模块,其中定义了如下记录类型:Type BooksName As String * 10TelNum As String * 20End Type在窗体上画一个名为 Command1 的命令按钮,要求当执行事件过程 Command1_Click 时,在顺序文件Person.txt 中写入一条 Books 类型的记录。下列能够完成该操作的事件过程是A ) Private Sub Command1_Click()Dim B As BooksOpen “ Person.txt ” For Output As #`1B.Name=InputBox( “ 输入姓名 ” )B.TelNum=InputBox( “ 输入电话号码 ” )Write #1,B.Name,B.TelNumClose #1End SubB ) Private Sub Command1_Click()Dim B As BooksOpen “ Person.txt ” For input As #`1B.Name=InputBox( “ 输入姓名 ” )B.TelNum=InputBox( “ 输入电话号码 ” )Print #1,B.Name,B.TelNumClose #1End SubC ) Private Sub Command1_Click()Dim B As BooksOpen “ Person.txt ” For Output As #`1B.Name=InputBox( “ 输入姓名 ” )B.TelNum=InputBox( “ 输入电话号码 ” )Write #1,BClose #1End SubD ) Private Sub Command1_Click()Open “ Person.txt ” For input As #`1Name=InputBox( “ 输入姓名 ” )TelNum=InputBox( “ 输入电话号码 ” )Print #1, Name, TelNumClose #1End Sub
设在工程中有一个标准模块,其中定义了如下记录类型:Type Books Name As String *10 Te1Num As String *20End Type 在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1_Click时,在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是。A.Private Sub Command1_Click() Dim B As Books Open"c":\Person.txt"For Output As #1 B.Name=InputBox("输入姓名") B.Te1Num=InputBox("输入电话号码") Write #1,B.Name,B.Te1Num Close #1 End SubB.Private Sub Command1_Click() Dim B As Books Open"c":\Person.txt"For Input As #1 B.Name=InputBox("输入姓名") B.Te1Num=InputBox("输入电话号码") Prite #1,B.Name,B.Te1Num Close #1 End SubC.Private Sub Command1_Click() Dim B As Books Open"c":\Person.txt"For Output As #1 B.Name=InputBox("输入姓名") B.Te1Num=InputBox("输入电话号码") Write #1,B Close #1 End SubD.Private Sub Command1_Click() Open"c":\Person.txt"For Input As #1 Name=InputBox("输入姓名") Te1Num=InputBox("输入电话号码") Prite #1,Name,Te1Num Close #1 End Sub
在窗体上画一个命令按钮和一个文本框,并将窗体的KeyPreview属性设置为True,然后编写如下代码: Dim SaveAll As String Private Sub Form_Load() Show Text1.Text=" " Text1.SetFocus End Sub Private Sub Command1_Click() Text1.Text = Ucase(SaveAll) End Sub Private Sub Form_KeyPress(KeyAscii As Integer) SaveAll=SaveAll+Chr(KeyAscii) End Sub 程序运行后,在键盘上输入abcdefg,单击命令按钮,则文本框中显示的内容为A.abcdefgB.不显示任何信息C.ABCDEFGD.出错
在窗体上添加一个命令按钮(名为Command1),然后编写如下程序:Private Sub Command1_Click()Dim a As Integer,b As Integerx=10y=20End Sub打开窗体运行后,单击命令按钮,消息框的输出结果为( )。
在窗体上画一个命令按钮,然后编写如下程序: Private Sub Command1_Click() Dim a As Integer, b As integer b = 1 For a = 1 To 100 If b >= 10 Then Exit For If b Mod 3 = 1 Then b = b + 3 End If Next a Print a End Sub 在命令按钮上单击后,窗体上显示的结果是 ______。A.101B.6C.5D.4
设在工程中有一个标准模块,其中定义了如下类型: Type stutype ino As Integer strname As String*20 strsex As String*1 smark As Single End Type 在窗体上画一个名为Connnand1的命令按钮,要求当执行事件过程Command1_Click时,在c:\的随机文件student..dat写入一条记录。下列能够完成该操作的事件过程是( )。A.Sub Command1_C1ick() Dim student As studtype Dim record_no As Integer record_no=1 With student .ino=12 .strname="smith" .strsex="男" .smark=89 End With Open" c:\student.dat" For input As # 1 len=len(student) Put # 1,record_B.Sub Command1_Click( ) Dim student As studtype Dim record_no As Integer record_no=1 With student .ino=12 .strname="smith" .strsex="男" .smark=89 End With Open"c:\student.dat" For random As #1 len=len(student) Put #1,record_nC.Sub Command1_Click() Dim student As studtype Dim record_no As integer record_no=1 With student .ino=12 .stmame="smith" .strsex="男" .smark=89 End With Open"c:\student.dat" For random As #1 len=len(student) Write #1,record_nD.Sub Command1_Click() Dim Student As studtype Dim Record_no As Integer record_no=1 With student .ino=12 .strname="smith" .strsex="男" .smark=89 End With Open"c:\student.dat"For output As #1 len=len(student) Put #1,record_no,
在窗体上画一个名称为Command1命令按钮,然后编写如下事件过程: Private Function fun1(n As Integer)As Integer Dim k As Integer If n = 1 Then k = 1 Else k = 1 + fun1(n - 1)* 2 End If fun1 = k End Function Private Sub Command1_Click () Dim m As Integer, x As Integer x = 4 m = fun1 (x) Print m End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是A.4B.6C.9D.15
在窗体上画一个命令按钮,然后编写如下代码:Private Type RecordR_ID As IntegerR_Name As String * 20Ene TypePrivate Sub Commandl_Click( )Dim M _Sise, N_Char, M_CharOpen" c: \file. txt" For Input As 1M_sise=LOF(1)For N_Char = M_Sise To 1 Step - 1Seek1, Next CharM_char = Input(1 ,1)NextPrint EOF(1)Close1End Sub程序运行后,单击命令按钮,其输出结果为【 】。
在窗体上画一个命令按钮(名称为Command1),然后编写如下事件过程: Private Sub Command1_Click() Dim b As Integer b=b+1 End Sub 运行程序,三次单击命令按钮后,变量b的值是: ______。A.0B.1C.2D.3
设在工程中有一个标准模块,其中定义了如下记录类型: TyPe Record ID A3 Integer Name As String*20 End TyPe 在窗体中添加一个名为Command1的命令按钮,假设d:\F1.dat文件中含有5个用户自定义类型的记录。要求当执行事件过程Command1_Click时,随机访问该文件,并把文件中的第4条记录读出。下列能够完成该操作的程序段是A.Private Sub Command1_Click( ) Dim MyRecord As Record,Position Open"d:\F1.dat"For Random As#1 Len=Len(My RecorD)Position=4 Get#1,Position,Myrecord Close #1 End SubB.Private Sub Command1_Click( ) Dim MyRecord As Record,Position Open"d:\F1.dat"For Random As #1 Len=Len(MyRecorD)Position=4 Put #1,Position,MyRecord Close#1 End SubC.Private Sub Command1_Click( ) Dim MyRecord As Record,Position Open"d:\F1.dar"For OutPut As #1 Len=Len(My RecorD0Position=4 Get #1,Position,MyRecord Close#1 End SubD.Private Sub Command1_Click( ) Dim MyRecord As record,Position Open"d:\F1.dat"For lnput As #1 Len=Len(MyRecorD)Position=4 Get #1,Position,MyRecord Close#1 End Sub
设在工程文件中有—个标准模块,其中定义了如下记录类型:Type Books Name As String *10 TelNum As String*20End Type在窗体上画—个名为Command1的命令按钮,要求当执行事件过程Command1_Click时,在顺序文件Petson.txt中写入一条Books类型的记录。下列能够完成该操作的事件过程是 ______。A.Private Sub Command1_ Click() Dim B As Books Open "Person.txt" For Output As #1 B. Name=InputBox(“输入姓名”) B. TelNum=InputBox(“输入电话号码”) Write #1, B. Name, B. TelNum Close #1End SubB.Private Sub Command1_ Click() Dim B As Books Open "Person.txt" For Input As #1 B. Name=InputBox(“输入姓名”) B.TelNum=InputBox(“输入电话号码”). Print #1, B. Name, B.TelNum Close #1End SubC.Private Sub Command1_Click() Dim B As Books Open "Person.txt" For Output As #1 B.Name= InputBox(“输入姓名”) B.TelNum=InputBox(“输入电话号码”) Write #1,B Close #1End SubD.Private Sub Command1_ Click() Open "Person. txt" For Input As #1 Name=InputBox(“输入姓名”) TelNum=InputBox(“输入电话号码”) Print #1, Name, TelNum Close #1End Sub
在窗体上画一个命令按钮和一个文本框,并把窗体的KeyPreview属性设置为True,然后编写如下代码: Dim SaveAll As String Private Sub Command1_Click() Text1.Text=UCase(SaveAll) End Sub Private Sub Form_KeyPress(KeyAscii As Integer) SaveAll=SaveAll+Chr(KeyAseii) End Sub 程序运行后,在键盘上输入“abcdefg”,单击命令按钮,则文本框中显示的内容为 ______ 。A.abcdefgB.不显示任何信息C.ABCDEFGD.出错
在窗体上画一个命令按钮,然后编写如下代码: 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
设在工程中有一个标准模块,其中定义了如下记录类型Type Books Name As String *10 TelNum As String *20End Type在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1_ Click时,在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是______。A.Private Sub Command1_Click() Dim B As Books Open "c:\Person.txt" For Output As #1 B.Name=InpuBox(“输入姓名”) B.TelNum=InputBox(“输入电话号码”) Write #1,B.Name,B.TelNum Close #1End SubB.Private Sub Command1_ Click() Dim B As Books Open "c:\Person.txt" For Input As #1 B.Name=InputBox(“输入姓名”) B.teLNum=InputBox(“输入电话号码”) Ptint #1,B.Name,B.TelNum Close #1End SubC.Private Sub Command1_ Click() Dim B As Books Open "c:\Person.txt" For Output As #1 B.Name=InputBox(“输入姓名”) B.TelNum=InputBox(“输入电话号码”) Write #1,B Close #1End SubD.Private Sub Command1_ Click() Dim B As Books Open "c:\Person.txT" For Input As #1 Name=InputBox(“输入姓名”) TelNum=InputBox(“输入电话号码”) Print #1 Name. TelNum Close #1End Sub
在窗体上画一个按钮,然后编写如下的事件代码。在按钮上单击,输出为( )。 Private Sub fun() Static a As Integer a=a+2 Print a; End Sub Private Sub Command1_Click() Dim m As Integer For m=1 To 3 Call fun Next m End SubA.2 2 2B.0 0 0C.2 4 8D.2 4 6
已知c:\1.txt是一个非空文件,其程序代码如下。 Private Sub Command1_Click() Dim MaxSize,NextChar,MyChat Open"c:\1.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 程序运行后,单击命令按钮,其输出结果为______。A.TrueB.NullC.0D.False
在窗体上画一个命令按钮,然后编写如下代码: 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() Dim a As Integer,b As Integer,c As Integer If a=0 Then x=x-1 Else If b<>0 Then End If End If If c<>0 Then x=3 Else x=4 End If Print x End Sub 程序运行后,单击命令按钮,其输出结果为 ______。A.34B.4C.35D.3
在窗体上画一个命令按钮,然后编写如下代码: 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 Max Size=LOF(1) For Next Char=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() Dim x(5)As String Dim n AS Integer For n : 4 TO 0 Step -1 x(n)= n + 1 Print x(n); Next n End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是A.54321B.4C.54321D.0
在窗体上画一个名称为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
设在工程中有一个标准模块,其中定义了如下记录类型 Type Books Name As String* 10 TelNum As String * 20 End Type 在窗体上画一个名为 Command1的命令按钮,要求当执行事件过程Command1 Click时, 在顺序文件Person.txt中写入一条记录。 下列能够完成该操作的事件过程是 ______。A.Private Sub Command1_Click( ) Dim B As Books Open "c:\Person.txt" For Output As #1 B.Name = InputBox("输入姓名") B.TelNum = InputBox("输入电话号码") Write #1, B.Name, B.TelNumB.Private Sub Command1_Click( ) Dim B As Books Open "c:\Person.txt, For Input As # 1 B.Name = lnputBox("输入姓名") B.TelNum = InputBox("输入电话号码") Print #1, B.Name, B.TelNttmC.Private Sub Command1_Click( ) Dim B As Books Open "c:\Person.txt" For Output As #1 B.Name = InputBox("输入姓名") B.TelNum = InputBox("输入电话号码") Write # 1, B Close #D.Private Sub Command1_Click( ) Dim B As Books Open"c:\Person.txt" For Input As #1 Name=InputBox("输入姓名") TelNum=InputBox("输入电话号码") Print #1,Name,TelNum Close #1 End Sub
在窗体上画一个命令按钮,然后编写如下程序 Private Sub Command1_Click( ) Dim a As Integer,b As hiteger a=1 b=2 Print N(a,B)End Sub Function N(x As Integer,y As Integer)As Integer N=IIf(xy,x,y) End Function 程序运行后,单击命令按钮,输出结果为A.1B.2C.5D.8
在窗体上画一个命令按钮,名称为Command1。然后编写如下程序: Private Sub Command1_Click() Dim a As Integer,b As Integer,c As Integer If a=0 Then x=x-1 Else If b<>0 Then End If End If If c<>0 Then x=3 Else x=4 End If Print x End Sub程序运行后,如果单击命令按钮,则在窗体上显示的内容是( )。A.34B.4C.35D.3
窗体上画一个命令按钮,然后编写如下代码: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