How to return multiple variables?
I want to return variable win, loss and draw but i dont know how.
22 Replies
My code:
$paste
If your code is too long, you can post to https://paste.mod.gg/ and copy the link into chat for others to see your shared code!
em okay
its not too long
it has some error
You can return a tuple if you don't want to create a new class
But not sure why you'd like to return the same value as the parameters
How can I use tuples?
em
So in your case,
I see
thanks
You could also use a class or a record, but a tuple is probably the easiest here.
thats record?
A tuple is not a record
whats*
A record would look like this
thinking one writing another
hmm okay
thanks
Translate error?
for a non-satic field, method, or propert ... an object reference is required
well like it says, an object reference is required to access this method
it was
static
in ur code, did u remove that word?nope
You gave it two return types
int (int, int, int)
Does it return an int
?
Or an (int, int, int)
?AAAAAA... yes
now everything works