Last post Jan 19, 2016 08:09 AM by Chris Zhao
Jan 18, 2016 04:53 PM|esims|LINK
Can I pass an external value to a global variable in a class? Right now, I do it like this:
Public Class myClass
Dim myGlobalVar as string
Public Function myFunction(myVar as string)
As you see, I am using two variables, and assign the value of the local variable to the global variable in the function. I wonder if you can do this more efficient, i.e. using only one variable.
Jan 19, 2016 08:09 AM|Chris Zhao|LINK
You could create a class with shared properties:
Public Class GlobalVariables
Public Shared Property MyGlobalString As String
Access the global variables
GlobalVariables.MyGlobalString = "Test"