MOO-cows Mailing List Archive


Re: Coding Problem

James Renken writes:
> How do I make the following code work?  Right now, it just gives me the
> "ERROR: Could not access text on object." every time.
> otret = $string_utils:explode(args[1], "?")[1];
> otrargs = $string_utils:explode($string_utils:explode(args[1], "?")[2], ",");
> if ($object_utils:has_callable_verb(otret, "return_text"))
>   if (typeof(otrargs) != ERR)
>     otret:return_text(@otrargs);
>   else
>     otret:return_text();
>   endif
> else
>   notify(player, "ERROR: Could not access text on object.");
>   move(otret, otret.owner);
> endif

The call to $object_utils:has_callable_verb() will always fail because `otret'
is always a string (since it's part of the result of $string_utils:explode()).
Perhaps you should use toobj() on it.



Home | Subject Index | Thread Index