I’d like to think that I am decent at Visual Basic, but, while I was learning JavaScript the other day, I found something that seemed awesome and now I can’t figure out how to do it in Visual Basic.
In JavaScript, it looks like this:
var someValue = getThatValue()
It’s both calling and setting the value from the getThatValue() sub. What is the Visual Basic equivalent?
I’ve tried doing this:
Private Sub main()
Dim value = getValue()
' Do something with value
End Sub
Private Sub getValue()
return 3
End Sub
That doesn’t seem to work. How can I get that to work?
1 Answer