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.

DarkBASIC Discussion / Function Question

Author
Message
Mobly
22
Years of Service
User Offline
Joined: 11th May 2003
Location:
Posted: 11th May 2003 11:14
I would like to know if you can return more than one thing from a function? I know you can send more than one to the function. Not sure about the returning.
How would you use a function to update a sprites position when it can not recognize golbal variables and only send back one thing. or am I missing the boat completly.

Thanks
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 11th May 2003 11:18
No, you cant easily return more than one thing from a function - you could always combine several things, but it would probably be too time consuming to seperate them again.

Easiest way is to return one value and also modify one or more global variable(s).

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Mobly
22
Years of Service
User Offline
Joined: 11th May 2003
Location:
Posted: 11th May 2003 11:43
Thanks! I forgot about declaring with Dim and making the X and y's global.

Danmatsuma
22
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 11th May 2003 12:00
Yep 'tis the way to go, though there are doubters



It'll just make something that looks like diffracted light shining through a small hole, in other words a bunch of jittery ghosted boxes on an angle

ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.

Login to post a reply

Server time is: 2025-05-17 03:00:15
Your offset time is: 2025-05-17 03:00:15