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 / Pointers? References?

Author
Message
Hell IVIonkey
23
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 4th Apr 2003 00:26 Edited at: 4th Apr 2003 00:27
DB funtions pass by value. Is there a way to pass a pointer, then dereference it? Can this be achieved through memblock functions, and if so, how? If not, is there a way to return more than 1 variable from a function without using some type of array? (if that's even possible)

I'm getting sick of gosubs...
Hell IVIonkey
23
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 4th Apr 2003 23:40
I'm sure this would be an easy question to answer for somebody who uses the enhancement pack... *sigh*
QuothTheRaven
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 5th Apr 2003 01:39
yes? I don't understand the question....speceficality?

Darken the skies, we are god
http://www.DelvarWorld.com
Hell IVIonkey
23
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 5th Apr 2003 03:24
In C, you tackel the problem of only returning 1 variable from a function with pointers.

Example of problem:


The screen will display that x=5 and y=10, not y=0

This is tackled by passing the "label" in RAM of the variables. In the function, you go to where the label is pointing and change that place in RAM directly, instead of creating temporary variables to return a value.

This will actually report that x=5 and that y=0!

Any way to do this in DB?
rockfistus
23
Years of Service
User Offline
Joined: 31st Mar 2003
Location:
Posted: 5th Apr 2003 04:23
Yeah it's hard to get any response to questions like this....

Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 5th Apr 2003 04:25
"Any way to do this in DB?"

No, only in DBPro. Another good reason to upgrade

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
rockfistus
23
Years of Service
User Offline
Joined: 31st Mar 2003
Location:
Posted: 5th Apr 2003 04:41


Dave J
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 5th Apr 2003 04:43
Pointers and References were one of the things that really confused me about C++ hehe.

"Computers are useless they can only give you answers."
Hell IVIonkey
23
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 5th Apr 2003 04:46
So what does the enhancement pack do? Any link that could be provided at least?
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 5th Apr 2003 04:54
DLL support, multiplayer, etc. See the DarkMATTER page for the full list of new commands you get. http://www.darkbasic.com/darkmatter

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Hell IVIonkey
23
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 5th Apr 2003 05:04
Thanks

Login to post a reply

Server time is: 2026-06-11 15:09:12
Your offset time is: 2026-06-11 15:09:12