正在加载图片...
参数 ↑形参和实参 形参是在sub或 function过程定义中出现的参数表,实参 则是在调用过程中给定的参数表。例如: Function gcd(byval x as integer, byval y Sub recarea (rien as single, as integer) as integer rid as single do while y<>0 dim area as single reminder=x mod y area= ren * rid X=Y msgbox the area of this y=reminder rectangle is"& area LOop End sub Gcd=x Sub form click End function dim a, b Sub form-clickol a=inputbox(" input the dim a as integer, b as integer,c length”) a=inputbox (a) b=inputbox (input the b=inputbox (B) width C= gcd( call recarea(val(a),val(b)) Print a&"和"&b&"的最大公约数是"&c End sub End sub 上面绿色字符是形参,蓝色字符是实参,以及前而例子中的参数形参和实参 形参是在sub或function过程定义中出现的参数表,实参 则是在调用过程中给定的参数表。例如: 参数 Function gcd (byval x as integer, byval y as integer) as integer do while y<>0 reminder=x mod y x=y y=reminder Loop Gcd=x End function Sub Form_click() dim a as integer, b as integer ,c a=inputbox(a) b=inputbox(B) C= gcd(val(a),VAL(b)) Print a & "和 " & b & "的最大公约数是" & c End sub Sub recarea(rlen as single, rwid as single ) dim area as single area=rlen *rwid msgbox “the area of this rectangle is” & area End sub Sub form_click() dim a,b a=inputbox (“input the length”) b=inputbox (“input the width”) call recarea(val(a),val(b)) End sub 上面绿色字符是形参,蓝色字符是实参,以及前面例子中的参数
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有