Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

return

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Bagne
ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA




Joined: 19 Feb 2003
Posts: 518
Location: Halifax

PostPosted: Sat Apr 17, 2010 6:02 am    Post subject: return Reply with quote

Can functions only return 1 value?
I'd like to return 3.
Do I just have to wait until arrays?
_________________
Working on rain and cloud formation
Back to top
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Sat Apr 17, 2010 10:23 am    Post subject: Reply with quote

Yes, functions can only return 1 value.

There won't be an easy way to return 3 values until arays are implemented.

There are some harder ways to fake it.

One is to use global variables for the other two return values.

Another is to return an NPC reference or a Slice handle, with the return values packed in the "extra" data.

Neither of those is particularly easy to use, but they might be good enough for now?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Sun Apr 18, 2010 12:23 am    Post subject: Reply with quote

I'm wondering whether we should support unpacking multiple return values. The new language features on that page are only suggestions, and for the most part have not been discussed. Some of them are probably too radical.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Newbie_Power




Joined: 04 Sep 2006
Posts: 1762

PostPosted: Sun Apr 18, 2010 1:41 am    Post subject: Reply with quote

I've used arguments as an improvised way to gain more values out of a script before.
_________________

TheGiz> Am I the only one who likes to imagine that Elijah Wood's character in Back to the Future 2, the kid at the Wild Gunman machine in the Cafe 80's, is some future descendant of the AVGN?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group