[DGD]Dynamic Array of Objects ?

Erwin Harte harte at xs4all.nl
Tue Feb 20 18:24:25 CET 2001


On Tue, Feb 20, 2001 at 11:11:08AM -0500, Michel Racicot wrote:
> Hi there
> 
>   How can i do a dynamic array of objects ?
> 
>   like :
>   object * lstExits;
> 
>   How can i add something to this array ? (There are no allocate functions for that kind of stuff!!!) 

Pardon?  You mean something like the allocate() kfun?  Example:

    lstExits = allocate(4);

This will create an array of size 4 with nil for each entry, identical
to doing this:

    lstExits = ({ nil, nil, nil, nil });

If you want to add more entries, the + operator will be most helpful:

    lstExits += allocate(3);

Which does the same as:

    lstExits += ({ nil, nil, nil });

Erwin.
-- 
Erwin Harte         :    `Don't mind Erwin, he gets crabby. :)'
harte at xs4all.nl     :       -- Par Winzell <zell at skotos.net>

List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list