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 Professional Discussion / Are there any pointers?

Author
Message
Sephnroth
23
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 21st May 2003 12:03
Quicky question, is there anyway to use pointers in dbp? I had a look through help and in the data types tutorial, couldnt find anything. talking about c/c++ like pointers, so lets say i wanted to pass a string variable to a function i would like to do something like change_this_string(*a_string) and then anything that the function does to the a_string var effects it globally.

possiable or not?
p4 2.4ghz, 256ddr ram, Geforce4 MX 440
Innovate, redefine, recreate whats in your mind. It isnt fate, you decide, only you can cross that line.
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 21st May 2003 12:15
Yes, there are pointers, although they are limited...
The best bit is to use 'Memory Allocated Pointers' (or MAPS©®™).

That is : You allocate memory and let a wonderful (and exciting) plug-in do the work by poking/peeking data to a given memory address.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st May 2003 15:11
There's a plugin on my site (the utility plugin) that allows you to get the address of a string, and that same plugin provides peek/poke for all types.

MrTAToad also has peek/poke, but I'm not sure that it has string addresses.
Sephnroth
23
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 21st May 2003 16:59
Thanks to both MrTAToad and IanM Appreichate the info, gonna go mess with my memory now

p4 2.4ghz, 256ddr ram, Geforce4 MX 440
Innovate, redefine, recreate whats in your mind. It isnt fate, you decide, only you can cross that line.
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 21st May 2003 18:32 Edited at: 21st May 2003 18:33
Yes, much certainly does has memory string commands - with options for them as well (convert to uppercase/lowercase/leave alone/add NULL)

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!

Login to post a reply

Server time is: 2026-07-11 19:06:17
Your offset time is: 2026-07-11 19:06:17