www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Error: undefined identifier remove

reply Patrick Chasco <Patrick_member pathlink.com> writes:
Hello

I'm receiving an error when trying to call remove() on an associative array. I
can't seem to figure this out, as the documentation states that the proper way
to remove an item from an associative array is to use the remove method.

Thanks in advance.


The errors:
noba\scene.d(46): undefined identifier remove
noba\scene.d(46): function expected before (), not remove of type int

The relevant code:
typedef uint OBJECTID;
class ObjectBase
{
public void remove_child(ObjectBase o) 
{
// Error occurs on this line
children.remove(o.id);
}

public:
ObjectBase[OBJECTID] children;
OBJECTID id;
}
Jun 10 2005
parent Derek Parnell <derek psych.ward> writes:
On Fri, 10 Jun 2005 20:31:00 +0000 (UTC), Patrick Chasco wrote:

 Hello
 
 I'm receiving an error when trying to call remove() on an associative array. I
 can't seem to figure this out, as the documentation states that the proper way
 to remove an item from an associative array is to use the remove method.
 
 Thanks in advance.
 
 
 The errors:
 noba\scene.d(46): undefined identifier remove
 noba\scene.d(46): function expected before (), not remove of type int
 
 The relevant code:
 typedef uint OBJECTID;
 class ObjectBase
 {
 public void remove_child(ObjectBase o) 
 {
 // Error occurs on this line
 children.remove(o.id);
 }
 
 public:
 ObjectBase[OBJECTID] children;
 OBJECTID id;
 }
Are you use v0.126? It compiles fine for me (Windows XP) -- Derek Parnell Melbourne, Australia 11/06/2005 10:36:32 AM
Jun 10 2005