ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] Åܼƪº¤Þ¥Î

[µo°Ý] Åܼƪº¤Þ¥Î

¤p§Ì³Ìªñ¬ðµo©_·Q¡A¤£ª¾¹D¥i¤£¥i¥H¤Þ¤JA¼Ò²Õ¸Ì­±ªºÅܼƨìB¼Ò²Õ¸Ì­±¥h¨Ï¥Î©O¡H¡H

¨Ò¦p¡G

sub A()
X=10
end sub

sub B()
msgbox X
end sub

¦b¼Ò²ÕBªº®É­Ô¡A¦L¥X¼Ò²ÕA¸Ì­±XÅܼƪº­È¡A10¡C³o¥i¥H¶Ü¡H
ªì¾ÇVBA¥E¨ìtwbts

¦^´_ 1# play9091
A¼Ò²Õ    ¤½¥ÎÅÜ¼Æ Public
  1. Option Explicit
  2. Public x As Integer
  3. Sub A()
  4. x = 10
  5. End Sub
½Æ»s¥N½X
B¼Ò²Õ
  1. Sub B()
  2. MsgBox x
  3. End Sub
½Æ»s¥N½X

TOP

¦^´_  play9091
A¼Ò²Õ    ¤½¥ÎÅÜ¼Æ PublicB¼Ò²Õ
GBKEE µoªí©ó 2012-8-18 20:27



    ­è­è¦bª¦¤åªº®É­Ô¬Ý¨ì¦³¤H¼g¤F³o¤@¬q¡A·Ð½Ð¥ý¶i¸ÑÄÀ¤@¤U¬O¤°»ò·N«ä°Ú¡H¡H

sub test (X as integer)
ªì¾ÇVBA¥E¨ìtwbts

TOP

¦^´_ 3# play9091

¤Þ¥Îtest®É¥²¶·µ¹¤©¤@­Ó«¬ºA¬°integer¤§¤Þ¼Æx
¦Ótest±N¥H¦¹¤Þ­z°õ¦æ¨äµ{¦¡½X
¤ñ¦p»¡
sub aa()
call test(5)
end sub

sub test(x as integer)
x = x^2
msgbox x
end sub   

«h·|¦L¥X"25"

TOP

        ÀR«ä¦Û¦b : ¦Û¤v®`¦Û¤v¡A²ö¹L©ó¶ÃµoµÊ®ð¡C
ªð¦^¦Cªí ¤W¤@¥DÃD