Udefault()

From TinyMUX
Revision as of 01:50, 29 November 2010 by Ihavenomouth (talk | contribs) (New page: Category:Functions FUNCTION: {{Function|udefault([<obj>/]<attr>,<default case>[,<arg>]...)}} This function returns the value of the user-defined function as defined by <attr> (or...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


FUNCTION: udefault([<obj>/]<attr>,<default case>[,<arg>]...)

This function returns the value of the user-defined function as defined by <attr> (or <obj>/<attr>), as if retrieved via the u() function, with <args>, if the attribute exists and is readable by you.

Otherwise, it evaluates the default case, and returns that. The default case is only evaluated if the attribute does not exist or cannot be read.

Example

> &TEST me=[center(%0,5,*)]

> say udefault(Test,-- BOOM --,ACK)

You say, "*ACK*"


> &TEST me

> say udefault(me/Test,-- BOOM --,ACK)

You say, "-- BOOM --"

Related Topics

get(), get_eval(), u(), default(), edefault()