s=”this is the mainstring”,sub=”string”,strindex(s,sub)是()
第1题:
在窗体上画一个命令按钮和两个文本框,其名称分别为Command1、Text1和Text2,然后编写如下程序: Dim S1 As String,S2 As String Private Sub Form_Load() Text1.Text="" Text2.Text="" End Sub Private Sub Text1_KeyDown(KeyCode As Integer,Shift As Integer) S2=S2 & Chr(Keycode) End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) S1=S1 & Chr(KeyAscii) End Sub Private Sub Command1_Click() Text1.Text=S2 Text2.Text=S1 S1="" S2="" End Sub 程序运行后,在Text1中输入“abc”,然后单击命令按钮,在文本框Text1和Text2中显示的内容分别为______。
A.abc和ABC
B.abc和abe
C.ABC和abc
D.ABC和ABC
第2题:
A、Sub S1(ByVal n!())
B、Sub S1(n!) as Integer
C、 Function S1%(S1%)
D、 Function S1(ByVal n!)
第3题:
执行下列的程序,消息框里显示的结果是______。
Pfivate Sub Form_Click()
Dim Str As String
Str=""
S="Access"
For i=Len(S) To 1 Step-1
Str=Str&Mid(S.i,1)
Next I
MsgBox Str
End Sub
第4题:
以下程序用于求S=1+3+32+33+…+310的值。
Private Sub Commandl_Click()
S=1
T=1
ForI=1 To 10
T=______
S=S+T
NextI
Print"S=";S
End Sub
第5题:
A、Sub plus(sum, a , b ): sum = a + b: End Sub
B、Sub plus(ByVal sum , a , b ): sum = a + b: End Sub
C、Sub plus(sum , ByVal a, ByVal b ): sum = a + b: End Sub
D、Sub plus(sum , ByRef a , ByRef b ): sum = a + b: End Sub
第6题:
有如下SUB过程:
Sub s(x As Single,y As Single)
t=x
x=t / y
y=t Mod y
End Sub
在窗体上添加一个命令按钮,然后编写如下事件过程:
Private Sub Form_Click()
Dim a As Single
Dim b As Single
a=5
b=4
s a,b
Print a,b
End Sub
则程序运行后,单击命令按钮,输出的结果为【 】 。
第7题:
在窗体中添加一个命令按钮(名为Command1),然后编写如下代码:
Public x as integer
Private Sub Command1_Click( )
x=5
Call s1
Call s2
MsgBox x
End Sub
Private Sub s1( )
x=x+10
End Sub
Private Sub s2( )
Dim x as integer
x=x+10
End Sub
窗体打开运行后,单击命令按钮,则消息框的输出结果是______
第8题:
下列程序的执行结果为
Private Sub Command1_Click()
Dim s1 As String, s2 As String
s1= "abcd"
Call Transfer(s1, s2)
Print s2
End Sub
Private Sub Transfer (ByVal xstr As String, ystr As String)
Dim tempstr As String
i=Len(xstr)
Do While i >=1
tempstr=tempstr + Mid(xstr, i, 1)
i=i - 1
Loop
ystr=te mpstr
End Sub( )。
A.dcba
B.abdc
C.abcd
D.dabc
第9题:
执行下面的程序,消息框里显示的结果是_______。
Private Sub Form_Click()
Dim Str As String
Str=""
S="Access"
Fori=Len(S)To 1 Step-l
Str=Str&Mid(S,i,1)
Next i
MsgBox Str
End Sub
第10题:
在窗体中添加一个名称为Command1的命令按钮,然后编写如下程序: Public x As Integer Private Sub Command1_Click() x=10 Call s1 Call s2 MSgBox x End Sub Private Sub s1() x=x+20 End Sub Private Sub s2() Dim x As Integer x=X+20 End Sub 窗体打开运行后,单击命令按钮,则消息框的输出结果为______。
A.10
B.30
C.40
D.50