Q2 : Declare Function Multiply_Add Lib “test” (ByRef A as i as integer ) as integerQ2.1: Explain what is Declare Function used for ?Ans :Q2.2 : Explain the difference between ByRef and ByVal ?Ans :
Q2 : Declare Function Multiply_Add Lib “test” (ByRef A as i as integer ) as integer
Q2.1: Explain what is Declare Function used for ?
Ans :
Q2.2 : Explain the difference between ByRef and ByVal ?
Ans :
相关考题:
下面的子过程语句说明合法的是________。 A.Sub fib(ByRef i%())B.Sub fib(j%) As IntegerC.Functionf%(f%)D.Function f1!(ByValn%)
有下列函数过程:Function funl(ByVal x As Integer, ByVal y As Integer) Do While y 0 Reminder=x Mody x=y y=reminder Loop Funl=xEnnd Function在下列按钮单击事件中调用该函数,则该程序的运行结果是 Privatr Sub Commandl_Click() Dim a As Integer Dim b As Integer a=100 b=25 x=funl(a,b) Print x End SubA.0 B.25 C.50 D.100
下面4个CT函数中是用来判断用户输入的数是否为奇数的,是奇数的返回1,否则返回0,其中正确的是 ( )。A.Function CT(ByVal a As Integer)If a Mod 2=0 ThenReturn 0ElseReturn 1End ifEnd FunctionB.Function CT(ByVal a As Integer)If a Mod 2=0 ThenCT=0ElseCT=1End ifEnd FunctionC.Function CT(ByVal a As Integer)If a Mod 2=0 ThenCT=1ElseCT=0End ifEnd FunctionD.Function CT(ByVal a As Integer)If a Mod 2=0 ThenReturn 1ElseReturn 0End ifEnd Function
在窗体上画一个命令按钮,命名为Command1。程序运行后,如果单击命令按钮,则显示一个输入对话框,在该对话框中输入一个整数,并用这个整数作为实参调用函数过程F1,在F1中判断所输入的整数是否是奇数,如果是奇数,过程F1返回1,否则F1返回1,否则返回0。能够正确实现上述功能的代码是 。A.Private Sub Command1_Click() x=InputBox("请输入整数") a=F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then Return 0 Else Return 1 End If End FunctionB.Private Sub Command1_Click() x=InputBox("请输入整数") a=F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then F1= 0 Else F1= 1 End If End FunctionC.Private Sub Command1_Click() x=InputBox("请输入整数") F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then F1= 1 Else F1= 0 End If End FunctionD.Private Sub Command1_Click() x=InputBox("请输入整数") F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then Return 0 Else Return 1 End If End Function
下列子过程语句中正确的是( )。A.Sub fl(By Val()As Integer)B.Sub fl(n() As Integer)As IntegerC.Functionn fl(fl As Integer)As IntegerD.Function fl(ByVal f As Integer)
阅读如下程序, a = 1: b = 2: plus S, a, b: Print S:不能使其输出结果为3的plus过程为( )。 A、Sub plus(sum, a , b ): sum = a + b: End SubB、Sub plus(ByVal sum , a , b ): sum = a + b: End SubC、Sub plus(sum , ByVal a, ByVal b ): sum = a + b: End SubD、Sub plus(sum , ByRef a , ByRef b ): sum = a + b: End Sub
数组A在子过程或函数中定义为形参,正确的语句是( )。 A、Private Sub sele(ByVal A( ) As integer)B、Private Function sale(A() As Integer) As StringC、Private Sub sale(A() As Integer) As IntegerD、Private Sub sale(A(i) As Integer)
有以下函数过程: 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 SubA.0B.10C.50D.100
在窗体上画一个命令按钮,命名为CommandI。程序运行后,如果单击命令按钮,则显示一个输入对话框,在该对话框中输入一个整数,并用这个整数作为实参调用函数过程 F1,在F1中判断所输入的整数是否是奇数,如果是奇数,过程F1返回1,否则返回0。 能够正确实现上述功能的代码是A.Privme Sub Command1_Click() x=InputBox(“请输入整数”) a=F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then Return 0 Else Return 1 End If End FunctionB.Private Sub Command1_Click() x=InputBox(“请输入整数”) a=F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then F1=0 Else F1=1 End If End FunctionC.Private Sub Command1_Click() x=InputBox(“请输入整数”) F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then F1=1 Else F1=0 End If End FunctionD.Private Sub Command1_Click() x=InputBox(“请输入整数”) F1 (Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then Return 0 Else Return 1 End If End Function
有如下函数过程: Function funl(ByVal x As Integer,ByVal y As Integer)As Integer Do While y<>0 reminder=x Mod y x=y y=reminder Loop fun1=x End Function 在下列按钮单击事件中调用该函数,则该程序的运行结果是( )。 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a=100 b=25 x=funl(a,B)Print x End SubA.0B.25C.50D.100
有如下函数过程。Function UNC(ByVal x As Integer,ByVal y As Integer)As IntegerDo While y<>0S=x/yx=yy=SLoopUNC=xEnd Function以下事件调用该函数,程序运行结果是【 】。Private Sub Command1_Click()Dim a As IntegerDim b As Integera=12b=2x=UNC(a,b)Print xEnd Sub
is nonprogram text embedded in a program to explain its form. and function to human readers.A.CommandB.CompileC.CommentD.Statement
Comment is nonprogram(78) embedded in a program to explain its form. and function to human readers.A.commandB.expressionC.textD.statement
下列子过程语句中正确的是( )。A.Sub f1(ByVal() As Integer)B.Sub f1(n() As Integer)As IntegerC.Function f1(f1 As Integer)As IntegerD.Function f1(ByVa1 f as Integer)
有下列函数过程: Function fun1(ByVal x As Integer,ByVal y As Integer)As Integer Do While y<>0 reminder=x MOd y x=y y=reminder Loop fun1=x End Function 在下列按钮单击事件中调用该函数,则该程序的运行结果是( )。 Private Sub Command1_Click() Dim aA.0B.25C.50D.100
下列子过程语句的说明正确的是( )。A.Sub fl(ByVal x() As Integer)B.Sub fl(x%())As IntegerC.Function fl%(fl%)D.Function fl%(x As Integer)
下面4个CT函数中是用来判断用户输入的数是否为奇数的,是奇数的返回1,否则返回0,其中正确的是A.Function CT(ByVal a As Integer) If a Mod 2=0 Then Return 0 ElSe Return 1 End if End FunctionB.Function CT(ByVal a As Integer) If a Mod 2=0 Then CT=0 Else CT=1 End if End FunctionC.Function CT(ByVal a As Integer) If a Mod 2=0 Then CT=1 Else CT=0 End if End FunctionD.Function CT(ByVal a As Integer) If a Mod 2=0 Then Return 1 Else Return 0 End if End Function
Q2 : Declare Function Multiply_Add Lib “test” (ByRef A as integer ,VeRef B as integer , ByVal c as integer ) as integerQ2.1: Explain what is Declare Function used for ?Ans :Q2.2 : Explain the difference between ByRef and ByVal ?Ans :
阅读程序: Function fac(ByVal As Integer)As Integer Dim temp As Integer temp=1 For i%=1 To n temp=temp*i% Next i% fac=temp End Function Private Sub Form. Click( ) Dim nsum As Integer nsum=1 For i%=2 T0 4 nsum=nsum+fac(i%) Next i% Print nsum End Sub 程序运行后,单击窗体,输出结果是( )。A.35B.31C.33D.37
在窗体上画一个名称为Commandl的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim n As Integer For n = 0 To 9 Step 3 Print rel(n); Next n End Sub Private Function rel(ByVal i As Integer)As Integer Dim x As Integer x = 0 For j = 1 To i If i < 5 Then rel = i: EXit Function x = x + i Next i rel = x End Function 程序运行后,单击命令按钮,则窗体上显示的内容是A.1 3 5 7B.2 8 14 53C.0 3 21 45D.0 5 11 34
下列子过程语句的说明正确的是( )。A.Sub f1(ByVal x()As Integer)B.Sub f1(x%())As IntegerC.Function f1%(f1%)D.Function f1%(x As Integer)
以下是某个窗体的模块代码,请分析单击窗体后程序运行至"*"号位置时变量X、Y和Z的值分别是【 】。DIM X AS INTEGERDIM Y AS INTEGERPRIVATE SUB FORM_CLICK()DIM X AS INTEGERX=1Y=1CALL AA(Y+1)Z=BB(X)'* * * * * * *MSGBOX "X="X"/Y="Y"/Z="ZEND SUBPRIVATE SUB AA(BYVAL Z AS INTEGER)Y=Z+XZ=X+YEND SUBPRIVATE FUNCTION BB(BYREF Y AS INTEGERY=Y+1BB=X+YEND FUNCTION
填空题下列程序的运行结果是()。 Program test Implicit none Integer,parameter:: limit=10 Integer counter Integer:: ans=0 Counter=2 do while(counter=limit) ans=ans+counter counter=counter+2 end do Wrte(*,*)ans end
在Oracle 中,下列语句中哪些可以合法地创建一个函数? (1.0分) [多选] A. CREATE FUNCTION func_name(cdcode NUMBER) RETURN CHAR IS DECLARE dis_cd CHAR(15);BEGIN .. END; B. CREATE FUNCTION func_name(cdcode NUMBER) RETURN CHAR IS dis_cd CHAR(15);BEGIN .. END; C. CREATE FUNCTION func_name(cdcode NUMBER) ISBEGIN .. END; D. CREATE FUNCTION func_name(cdcode NUMBER) RETURN CHAR ISBEGIN .. END; E. CREATE FUNCTION func_name(cdcode NUMBER) RETURN CHAR IS DECLARE dis_cd STRING (15);BEGIN .. END;