熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

asp byref 讓函數同時返回多值幾種做法

2022-06-13   來源: .NET編程 

  我們就以asp教程來舉例說明關於如何在用戶自定義函數調用時反回多的值先來看一組代碼

  <% 
         call getmynumber(aabbcc) 
         responsewrite aa & " " & bb & "<br />" & cc 
         function getmynumber(byref aabyref bbbyref cc) 
         aa= 
         bb= 
         cc = 
         end function 
         %> 這裡是利用了byref再看詳細的

  sub test(byref a as integer byval b as integer)
             a =
             b =
         end sub
         sub main()
             dim a as integer
             dim b as integer
             a =
             b =
             test a b
             msgbox "a=" & a & ";b=" & b
         end sub
         輸出結果 a=;b=byref作用是存址參數通過操作參數的內存地址實現全局控制


From:http://tw.wingwit.com/Article/program/net/201311/12078.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.