View mode: basic / threaded / horizontal-split · Log in · Help
June 10, 2005
Error: undefined identifier remove
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;
}
June 11, 2005
Re: Error: undefined identifier remove
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
Top | Discussion index | About this forum | D home