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)
myGlobalVar=myVar
...
End Function
End Class
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.
Member
15 Points
93 Posts
Passing a value to a global variable
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:
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.
All-Star
17652 Points
3510 Posts
Re: Passing a value to a global variable
Jan 19, 2016 08:09 AM|Chris Zhao|LINK
Hi esims,
You could create a class with shared properties:
Access the global variables
Best Regards,
Chris Zhao