This might seem like an insanely easy question, but I can't seem to find an answer anywhere to it. I'd like to think that I am decent at VB 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 VB.
In javascript it looks like this:
var someValue = getThatValue()
It's both calling and setting the value from the getThatValue() sub. what is the VB 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?
Private Sub Main() Dim value = getValue() 'do something with value End Sub Private Function getValue() As Integer Return 3 End Function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With