Functions
I'm wandering if it's possible to get a function to return more than one value of different data types.
7 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
I'm not sure how to syntax to get multiple values out the function
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Or Just create a "container"/model class as return type
I managed to do it
I called the 3 datatypes of the values I return at the beginning of my function with brackets
im testing to see how it works now
Works perfect
thanks for this... I just couldn't get my head around the syntax
Plus I couldn't find examples of people returning multiple values from a function
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
I did:
(string, int, int) userLocation()
return (fLocation ,fRisk ,fKillPotential);
(location, risk, killPotential) = userLocation();
and it worked