Lagoon wrote:
I'm adding a case where it's very good to use byref. Spometimes you need a function which returns more than a value. There are two ways to do this:
1) returning an array, a struct (I prefere to use a struct when returned variables have different types, but it's not mandatory) or (in some particular cases) a dictionary
2) passing any number of (uninitialized) variables by reference and setting their values inside the function
Yup, that can work too! COM programmers on Windows, for example, will recognize this as pretty much how everything is done. Since the return value is very often reserved for the 'HRESULT', or basically the status code, most values are gotten back by passing variables into reference parameters.
I personally don't like that way of doing things, because I think that returning a struct is usually a better option. For example, all of the Core functions that return multiple, but differing values do so as members of a struct (those that return multiple like values do so by returning an array).
However, this isn't at all an invalid use of this, and might come in handy for some folks; Thanks for adding it!
