首页
题目
TAGS
首页
/
题库
/
[单选题]在过程定义中有语句:Private Su的答案
搜答案
在过程定义中有语句:Private Sub GetData(ByVal data As Integer),其中“ByVal”的含义是( )。
单选题
2022-01-03 05:08
A、传值调用
B、传址调用
C、形式参数
D、实际参数
查看答案
正确答案
A
试题解析
在VBA的过程调用时的参数传递有两种方式:传址传递和传值传递。如果在过程声明时形参用ByVal声明;说明此参数为传值调用,这时形参的变化不会返回给实参:若用ByRef声明,说明此参数为传址调用,此时形参的变化将会返回给实参,如果没有说明传递类型,则默认为传址方式。
标签:
感兴趣题目
设有以下函数过程Private Function Fun(a()As Integer,b As String)As IntegerEhd Function若已有变量声明:Dim x(5)As Integer,n As Integer,ch As String则下面正确的过程凋用语句是
假定以定义了一个过程sub add(a as single, b as single),则正确的调用语句是()
假定已经定义了一个过程SubAdd(a As Single,b As Single),则正确的调用语句是( )。
在窗体上画两个标签和一个命令按钮,其名称分别为Label1、Label2和Command1,然后编写如下程序: Private Sub func(L As Label,ByVal a As Integer) L.Caption="1234" a=a*a End Sub Private Sub Form_Load() Label1.Caption="ABCD" Label2.Caption=10 End Sub Private Sub Command1_Click() a=Val(Label2.Caption) Call func(Label1,A)Label2.Caption=a End Sub 程序运行后,单击命令按钮,在两个标签Label1和Label2中显示的内容分别是: ______。
在窗体上画两个标签和一个命令按钮,其名称分别为Labell、Label2和Command1,然后编写如下程序: Private Sub func(L As Label,ByVal a As Integer) L.Caption="1234" a=a*a End Sub Private Sub Form_Load() Label1.Caption="ABCD" Label2.Caption=10 End Sub Private Sub Command1_Click() a=Val(Label2.Caption) Call func(Labell,A)Label2.Caption=a End Sub 程序运行后,单击命令按钮,在两个标签Label1和Label2中显示的内容分别是 ______。
有以下函数过程: Function Gys (ByVal x As Integer, ByVal y As Integer) As Integer Do While y<>0 Reminder = x Mod y x = y y= Reminder Loop Gys=x End Function 以下是调用该函数的事件过程,该程序的运行结果是 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a = 50 b = 10 x=Gys (a,B)Print x End Sub
有如下函数过程: Function HFC(ByVal x AS Integer,ByVal y As Integer)As Integer Do While y < > 0 sic=x/y X=y y=sic Loop HFC=x End Function 以下是该函数的调用过程,该程序的运行结果是 Private Sub Command1 _ Click( ) Dim a AS Integer Dim b As Integer a=12 b=2 x=HFC(a,B)Print x End Sub
有如下函数过程: Function Fun (By Val x As Ingeger, ByVal y As Integer)As Integer Do While…y<>0 reminder=x Mod y x=y y=reminder Loop Fun=x End Function 以下是调用该函数的事件过程,该程序的运行结果是 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a=100:b=25 x=Fun(a,b)Print x End Sub
有如下函数过程: Function Fun(By Val x As Ingeger,ByVal y As Integer)As Integer Do While…Y<>0 reminder=x Mod Y x=y y=reminder Loop Fun=X End Function 以下是调用该函数的事件过程,该程序的运行结果是 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a=100:b=25 x=Fun(a,b) Print x End Sub
"程序中有两个过程Private Sub Fun1(S As String)和Private Sub Fun2(a()As String*6),在调用过程中用Dim St(6)As String*6定义了一个字符串数组。下面调用语句中正确的是() ①Call Fub1(St(3)) ②Call Fun2(St) ③Call Fun1(St) ④Call Fun2(St(6))
定义两个过程Private Sub Fun 1(S as String)和Private Sub Fun2 (a( )as String*6),在调用过程中用Dim St (6) as String*6定义了一个字符串数组。下面调用语句中正确的有()。 ①Call Fun1(St(3)) ②Call Fun2(St) ③Call Fun1(St) ④Call Fun2(st(6))
单击命令按钮时,下列程度段的执行结果为( )。 Private Sub Command1_Click() Dim a As Integer, b As Integer, c As Integer a=2:b=4:c=6 Call S1(a,B) Print "a="; a; "b="; b; "c="; c Call S2(a,B) Print "a ="; a; "b ="; b; "c="; c; End Sub Private Sub S1(x As Integer, y As Integer) Dim c As Integer x=2*x:y=y+2:c=x+y End Sub Sub S2(x As Integer, ByVal y As Integer) Dim e As Integer x=2*x:y=y+2:c=x+y End Sub
相关题目
在代码窗口中,有如下事件过程,以下叙述正确的是______。Private Sub Option1_Click(Index As Integer)……End Sub
有如下一个Sub过程: Sub mlt(ParamArray numbers()) n=1 For Each x In numbers n=n*x Next x Print n End Sub 在一个事件过程中如下调用该Sub过程: Private Sub Command1_Click() Dim a As Integer Dim b As Integer Dim c As Integer Dim d As Integer a=1 b=2 c=3 d=4 mlt a,b,c,d End Sub 该程序的运行结果为( )。
如果在定义Sub过程时没有使用Private、Public和Static关键字,则所定义的过程是().
在以下事件中,Private表示 Private Sub sub1(x As Integer,y As Integer) ...End Sub
在过程定义中有语句:Private Sub GetData(ByVal data As Integer),其中“ByVal”的含义是( )。
在过程定义中有语句: Private Sub GetData(ByRef f As Integer. 其中"ByRef"的含义是
编写如下事件过程和函数过程: Private Sub Command1_Click() Dim num(1 To 6) As Single num(1)=103: num(2)=190: num(3)=0 hum(4)=32:num(5)=-56: num(6)=100 Print Print p2(6,num()) End Sub Private Function p2(ByVal n As Integer, number() As Single) As Integer p2=number(1) For j=2 To n If number(j)<p2 Then p2=number(j) Next j End Function 程序运行后,在窗体上输出( )。
编写如下事件过程和函数过程: Private Sub Form_Chck() DimBum(1 To 6)As Single num(1)=103:num(2)=190:num(3)=0 Bum(4)=32:num(5)=-56:num(6)=100 Print Pdnt p2(6,hum()) End Sub Private Function p2(ByVal n As Integer,number()As Single)As Integer p2=
执行下列程序后,鼠标单击窗体,输出结果为 Private Sub Form_Click() Print"Click": End Sub Private Sub Form_MouseDown(Button As Integer,Shift_As Integer,X As Single,Y As Single) Print"Donw" End Sub Private Sub Form_MouseUp(Button As Integer,Shift_As Integer,X As Single,Y As Single) Print"Up" End Sub
执行下列程序后,鼠标单击窗体,输出结果为。 Private Sub Form_Click() Print“Click”; End Sub Private Sub Form_MouseDown(Button As Integer,Shift_ As Integer,X As Single,Y As Single) Print “Donw” End Sub Private Sub Form_MouseUp(Button As Integer,Shift_ As Integer,X As Single,Y As Single) Print“Up” End Sub
若看到程序中确以下事件过程,则可以肯定的是,当程序运行时( )。 Private Sub Click—MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single) Print"VB Program" End Sub
若看到程序中有以下事件过程,则可以肯定的是,当程序运行时( )。 Private Sub Click MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single) Print”Visual Basic Program” End Sub
若看到程序中有以下事件过程,则可以肯定的是,当程序运行时Private Sub Click_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single)Print”VB Program”End Sub
在Sub过程中,可以用Return语句退出Sub过程。
已知有下面过程: Private Sub proc1(a As Integer,b As String,Optional x As Boolean) ...... End Sub 正确调用此过程的语句是______。
已知有下面的过程Private Sub proc1(a As Integer,b As String,Optional x As Boolean)……End Sub正确调用此过程的语句是( )。
下面类的声明中的几个语句,正确的是(设定语句是主函数中的语句)( )。 class TestClass { private: int data; public: TestClass(int g_data) { data=g_data; } void show(){cout<<data<<end1;) };
在过程定义中有语句: Private Sub GetData(ByVal data As Integer)其中“ByVal”的含义是( )。
( 33 )在过程定义中有语句: Private Sub GetData (ByVal data As Integer)其中 “ ByVal ” 的含义是( ) 。
在下面的定义语句中,画线处应填入的内容是 class Fred{ public: void print( ){cout<<data<<endl;} void setData(double D) {data=d;} static int count; private: double data; }; ______count=0;//静态数据成员的定义
广告位招租WX:84302438
题库考试答案搜索网
免费的网站请分享给朋友吧