Switch to edit mode.
Name(s): eval_cndAttr1: " $xml!moo-help.dtd"
2: "<!ENTITY % cndAttr"
3: " \"if CDATA #IMPLIED"
4: " unless CDATA #IMPLIED\""
5: " >"
6: ""
7: "This verb takes an 'attr' argument from any of the _render_ functions and returns 1 if the function should proceed and 0 if the function should not. The attr's 'if' and 'unless' fields are evalulated to decide this. If neither of these fields exist, 1 will be returned. If both of these fields exist, the if must be true and the unless must be false for this to return 1."
8: {attr} = args
9: retval = 1
10: if (z = listassoc(attr, "if"))
11: expr = z[2]
12: expr = tostr("user = (player:isa($webber) ? player.user | player); return ", expr, " ;")
13: evalval = $no_one:eval(expr)
14: if (evalval[1])
15: retval = retval && evalval[2]
16: else
17: raise(E_NONE, tostr("*( Eval-Error: ", evalval[2][1], " )*-*/"))
18: endif
19: endif
20: if (z = listassoc(attr, "unless"))
21: expr = z[2]
22: expr = tostr("user = (player:isa($webber) ? player.user | player); return ", expr, " ;")
23: evalval = $no_one:eval(expr)
24: if (evalval[1])
25: retval = retval && !evalval[2]
26: else
27: raise(E_NONE, tostr("*( Eval-Error: ", evalval[2][1], " )*-*/"))
28: endif
29: endif
30: return retval
31: "Last modified by Lao-Tzu (#8084) on Sun Aug 11 07:35:21 2002 MDT."