GLBasic forum

Main forum => GLBasic - en => Topic started by: bigsofty on 2012-Mar-04

Title: DGArray
Post by: bigsofty on 2012-Mar-04
What is DGArray?  It looks similar to STLs List or Vector?

Is there some docs or and example, perhaps showing creation, traversing, adding, inserting and deleting. Pure C is fine as I am thinking that it should be good for a C++ dynamic array I need to create. It looks, to me at least, like the preferred GLB way of using C++ dynamic arrays/lists in inline C++ but I am unsure of the correct syntax.

Any help is greatly appreciated!  :)
Title: Re: DGArray
Post by: Kitty Hello on 2012-Mar-05
DGArray is a template container class. You can use:
Code (glbasic) Select

DGArray<anthing> myarray;

// allocation
DIM(myarray, 100);
// or:
DIMPUSH(myarray, thing);

DIMDEL(myarray, index);

// access (read/write)
myarray(index) = value;
// 2D, 3D, 4D arrays:
myarray(x,y) = value;


That's pretty much all about it.

Title: Re: DGArray
Post by: bigsofty on 2012-Mar-05
Ok, that looks quite simple, thank you Gernot.  :)