View/Edit #1:has_verb2

Switch to edit mode.

Name(s): has_verb2
1:  "object:has_verb([verbname] [,hasbits] [,rejectbits])"
2:  "Find out if an object has a verb matching the given verbname."
3:  "Returns {location,verbname} if so, 0 if not, where location is the object or the ancestor on which the verb is actually defined."
4:  {verbname, ?pinfo = "", ?ninfo = ""} = args
5:  set_task_perms(caller_perms())
6:  if (`info = verb_info(this, verbname) ! E_VERBNF, E_PERM')
7:    "{this} == TRUE, this == FALSE"
8:    ok = 1
9:    if (ok && pinfo)
10:     "pinfo is needed"
11:     for x in [1..length(pinfo)]
12:       if (!index(info[2], pinfo[x]))
13:         ok = 0
14:         break
15:       endif
16:     endfor
17:   endif
18:   if (ok && ninfo)
19:     "ninfo is not needed"
20:     for x in [1..length(ninfo)]
21:       if (index(info[2], ninfo[x]))
22:         ok = 0
23:         break
24:       endif
25:     endfor
26:   endif
27:   if (ok)
28:     return {this, info[3]}
29:   endif
30: endif
31: if (valid(parent(this)))
32:   return parent(this):has_verb2(@args)
33: endif
34: return 0
35: "Last modified by Lao-Tzu (#8084) on Tue Oct  8 14:35:21 2002 MDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

[home | help | who | search | setup | code]