Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / can a function return an array / two variables?

Author
Message
mathkid
19
Years of Service
User Offline
Joined: 1st Feb 2005
Location: Central Massachusetts
Posted: 13th Feb 2005 10:51
Is it possible to make a function return more than one variable and/or an array? The tutorials were rather unclear on this issue.
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 13th Feb 2005 18:08 Edited at: 13th Feb 2005 18:09
The straight answer is "No." However, Arrays and Global variables declaired in the main program transfer values to and from functions. There is no need to necessarily return these then.

Here's an example of a function code I use regularly that sets some globals, but never "returns a value."



"Droids don't rip your arms off when they lose." -H. Solo

REALITY II
mathkid
19
Years of Service
User Offline
Joined: 1st Feb 2005
Location: Central Massachusetts
Posted: 13th Feb 2005 21:20
Thank you! I'm working on my first game and right now I'm trying to clean the code up, make variables global, and put as much code as I can into functions in #include files.

Login to post a reply

Server time is: 2024-09-23 12:18:55
Your offset time is: 2024-09-23 12:18:55