0
在C中,标记为extern
的变量只需要在本地声明,但可以在外部定义。这可能与VBA?因此,我喜欢这样的事情:如何在VBA中声明一个`extern`变量?
DataSource_14.accdb:
' References CommonFunctions.accdb
Public SOURCE_ID As Long = 14
Public Sub Baz()
Foo
Bar
End Sub
CommonFunctions.accdb:
Extern SOURCE_ID As Long ' <- what's the proper way to declare this?
Public Sub Foo()
Debug.Print "Doing Foo stuff with source " & SOURCE_ID
End Sub
Public Sub Bar()
Debug.Print "Doing Bar stuff with source " & SOURCE_ID
End Sub