For the Structures, I would appreciate a New- and a Delete-Instruction for easily allocating and freeing Memory (without the need for a variable).
The New-Command should return a pointer with which I then can do all the interesting stuff, like my very own dynamic List- and Tree-Structures.
I really really miss this and it would simplify programming in PB so much, that's for me.
Thx
Mirko
New and Delete
-
- Enthusiast
- Posts: 613
- Joined: Tue May 06, 2003 2:50 pm
- Location: Germany
- Contact:
- tinman
- PureBasic Expert
- Posts: 1102
- Joined: Sat Apr 26, 2003 4:56 pm
- Location: Level 5 of Robot Hell
- Contact:
Re: New and Delete
like:freedimension wrote:The New-Command should return a pointer with which I then can do all the interesting stuff, like my very own dynamic List- and Tree-Structures.
*foo.mytype = AllocateMemory(Sizeof(mytype), 0)
FreeMemory(*foo)
Unfortunately, the memory library has not yet been updated to not require bank numbers. Or do you want the calling of constructor/destructor type procedures too? You could try my RawMemory library which lets you do this, but a Linux version does not exist for now (and I think the parameters are slightly different). http://www.reelmediaproductions.com/pb or my website.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
(WinXPhSP3 PB5.20b14)
-
- Enthusiast
- Posts: 613
- Joined: Tue May 06, 2003 2:50 pm
- Location: Germany
- Contact: