So, hypothetically, if I were to be trying to write a sort-of "GetMax" function between two numbers, and I wanted to return the largest of the two by reference, so I could edit said returned reference variable directly from the calling of the function.
So in CPP it could look like this:
int& GetMax(int& a, int& b)
{
if (a > b) {
return a;
}
else {
return b;
}
}
And I could edit it like this:
int main(void)
{
int a = 30;
int b = 20;
GetMax(a, b) = 10;
}
GetMax(a, b) = 10; Would change a's value.
Would I be able to do something similar in Visual Basic?
Function GetMax(ByRef a As Integer, ByRef b As Integer) As Integer
If a > b Then
Return a
Else
Return b
End If
End Function
^ But instead of returning a value, it would return a reference, so I could treat the function the same way I did in the CPP example. I haven't really dedicated myself to learning visual basic, so I don't really know if I'm completely missing a key concept that would allow me to do the thing that I wish. Thank you ! :)