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 / Question for IanM (Array ptr)

Author
Message
Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 24th Jul 2011 17:50
I was wondering if it is possible to get the ptr of an array and then insert items at the bottom of the array using the pointer.

It would be quite handy for a project I'm working on.

I have already created these functions:
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th Jul 2011 01:17
Yes,but with a very important side-effect - increasing the size of an array, or resizing using DIM makes your current pointer invalid, which complicates your code.

Here's an example of resizing an array via its pointer:


Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 25th Jul 2011 13:31
Thank you very much, it works great!

Login to post a reply

Server time is: 2026-07-11 12:01:09
Your offset time is: 2026-07-11 12:01:09