How to get a specific value from a method with multiple return values?
I want to access all of the int values when I call a method with the return line shown in the image, how would I go about writing it?
e.g. I want to assign exp & gold to variables but don't know how to get them (is it done through an index???)

4 Replies
two ways, either get the tuple, or deconstruct it to variables
you either give them a name (like
return (Name: value, Name: value, ...);
but names should be in the return type) so that you can access properties with that name
or you have to use Item1, Item2, and so onyou can also use
_
to discard some if you don't need them
you need to name the parts in the return for first to work
I was about to say that the first method didn't work so I used Item1-4 instead, but I named the parts in the method and it works if I do that, thanks