正在加载图片...
参数传递 参数按照两种方法传递(传地址和传值 传地址也叫做引用,默认情况下均为传地址:传值只传递实际参数,这种情况下,系统把要传递的变 临时单元中,然后该临时单元的地址被传递给过程,保证原 看下面例子 sub power (x as integer, byval y as integer X=×+100 y=y*6 print“×=“;X,"y=";y .函数使用方法 回 end sub Sub command2 click(一 80 dim a as integer, b the powers x=200 y=138 a=100:b=23 the command print the powers a=20 b=23 power a, b print“ the command: print“a=”;a,"b=";b 指名传递参数传递 End sub参数按照两种方法传递(传地址和传值) 传地址也叫做引用,默认情况下均为传地址;传值只传递实际参数,这种情况下,系统把需要传递的变量 复制到一个临时单元中,然后该临时单元的地址被传递给过程,保证原实参地址中的值不发生改变。 看下面例子: sub power (x as integer, byval y as integer) x=x+100 y=y*6 print “x=“;x, ”y=”;y end sub Sub command2_click() dim a as integer, b a=100:b=23 print “the powers:” power a, b print “the command:” print “a=”;a, ” b=”;b End sub 参数传递
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有