[DGD] Does object_name() not like mixed or...?
Robert Forshaw
iouswuoibev at hotmail.com
Tue Jan 13 22:55:27 CET 2004
Here's my function (it masks object_name()):
static nomask string object_name(mixed obj, varargs int master, int shed)
{
if(!obj) return nil;
if(IS_OBJECT(obj))
obj = ::object_name(obj);
else
{
obj = ::find_object(obj);
obj = ::object_name(obj);
}
if(master)
sscanf(obj, "%s#",obj);
if(!obj || obj == "")
return nil;
if(!shed)
return obj;
/* shed the filename */
obj = explode(obj, "/");
obj = obj[..sizeof(obj) - 2];
obj = "/" + implode(obj, "/") + "/";
return obj;
}
It keeps failing on the 10th line (obj = ::object_name(obj);).
With the runtime error: "Bad argument 1 for kfun object_name"
Why?
Under the conditions I've set down it should only ever be called with a
mixed variable pointer to an object.
Incidently, those two functions were originally on the same line like this:
obj = ::find_object(::object_name(obj));
_________________________________________________________________
Sign-up for a FREE BT Broadband connection today!
http://www.msn.co.uk/specials/btbroadband
_________________________________________________________________
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list