mufman.html
fbmuck-6.05/docs/mufman.html · 314.7 KB
From the archive fbmuck-6.05.tar.gz
Download the archive « Back to the archive contents
<html><head><title>MUF Reference Manual for FBMuck 6.00</title></head>
<body><div align="center"><h1>MUF Reference Manual for FBMuck 6.00</h1>
<h3>by Revar Desmera <revar@belfry.com></h3></div>
<ul><li><a href="#AlphaList">Alphabetical List of Topics</a></li>
<li><a href="#SectList">List of Topics by Category</a></li></ul>
<p><hr size="6"><h3><a name="SectList">List of Topics by Category</a></h3>
<h4>You can get more help on the following topics:</h4>
<ul> <li><a href="#DefDets">Details and Definitions</a></li>
<li><a href="#CompDefs">Macros and Compiler Directives</a></li>
<li><a href="#StackOps">Stack Manipulation Operators</a></li>
<li><a href="#VarHandling">Variables and Handling Thereof</a></li>
<li><a href="#LogicOps">Logical Operators</a></li>
<li><a href="#ExecStructs">Execution Control Structures</a></li>
<li><a href="#IOOps">I/O Operators</a></li>
<li><a href="#MathOps">Mathematical Operators</a></li>
<li><a href="#FloatOps">Floating Point Operators</a></li>
<li><a href="#StringOps">String Manipulation Operators</a></li>
<li><a href="#LockOps">Lock Manipulation Operators</a></li>
<li><a href="#ArrayOps">Array Manipulation Operators</a></li>
<li><a href="#PropOps">Property Manipulation Operators</a></li>
<li><a href="#DBOps">Database Related Operators</a></li>
<li><a href="#TimeOps">Time Manipulation Operators</a></li>
<li><a href="#ProcOps">Process Management Operators</a></li>
<li><a href="#ConnOps">Connection Management Operators</a></li>
<li><a href="#EventOps">Event Handling Operators</a></li>
<li><a href="#MCPOps">MCP Support Operators</a></li>
<li><a href="#GUIOps">GUI Support Operators</a></li>
<li><a href="#Exceptions">Exception Handling</a></li>
<li><a href="#Debug">Debugging</a></li>
<li><a href="#MiscOps">Miscellaneous</a></li>
</ul>
<p><hr size="6"><h3><a name="AlphaList">Alphabetical List of Topics</a></h3>
<h4>Symbols</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#!">!</a> </td>
<td nowrap> <a href="#$abort">$abort</a> </td>
<td nowrap> <a href="#$author">$author</a> </td>
<td nowrap> <a href="#$cleardefs">$cleardefs</a> </td>
<td nowrap> <a href="#$def">$def</a> </td>
</tr>
<tr>
<td nowrap> <a href="#$define">$define</a> </td>
<td nowrap> <a href="#$echo">$echo</a> </td>
<td nowrap> <a href="#$ifcancall">$ifcancall</a> </td>
<td nowrap> <a href="#$ifdef">$ifdef</a> </td>
<td nowrap> <a href="#$iflib">$iflib</a> </td>
</tr>
<tr>
<td nowrap> <a href="#$iflibver">$iflibver</a> </td>
<td nowrap> <a href="#$ifncancall">$ifncancall</a> </td>
<td nowrap> <a href="#$ifndef">$ifndef</a> </td>
<td nowrap> <a href="#$ifnlib">$ifnlib</a> </td>
<td nowrap> <a href="#$ifnlibver">$ifnlibver</a> </td>
</tr>
<tr>
<td nowrap> <a href="#$ifnver">$ifnver</a> </td>
<td nowrap> <a href="#$ifver">$ifver</a> </td>
<td nowrap> <a href="#$include">$include</a> </td>
<td nowrap> <a href="#$lib-version">$lib-version</a> </td>
<td nowrap> <a href="#$libdef">$libdef</a> </td>
</tr>
<tr>
<td nowrap> <a href="#$note">$note</a> </td>
<td nowrap> <a href="#$pragma">$pragma</a> </td>
<td nowrap> <a href="#$pubdef">$pubdef</a> </td>
<td nowrap> <a href="#$undef">$undef</a> </td>
<td nowrap> <a href="#$version">$version</a> </td>
</tr>
<tr>
<td nowrap> <a href="#%">%</a> </td>
<td nowrap> <a href="#'">'</a> </td>
<td nowrap> <a href="#*">*</a> </td>
<td nowrap> <a href="#+">+</a> </td>
<td nowrap> <a href="#++">++</a> </td>
</tr>
<tr>
<td nowrap> <a href="#-">-</a> </td>
<td nowrap> <a href="#--">--</a> </td>
<td nowrap> <a href="#/">/</a> </td>
<td nowrap> <a href="#<"><</a> </td>
<td nowrap> <a href="#<= "><= </a> </td>
</tr>
<tr>
<td nowrap> <a href="#=">=</a> </td>
<td nowrap> <a href="#>">></a> </td>
<td nowrap> <a href="#>=">>=</a> </td>
<td nowrap> <a href="#@">@</a> </td>
<td nowrap> <a href="#\">\</a> </td>
</tr>
<tr>
<td nowrap> <a href="#__fuzzball__">__fuzzball__</a> </td>
<td nowrap> <a href="#__muckname">__muckname</a> </td>
<td nowrap> <a href="#__version">__version</a> </td>
<td nowrap> <a href="#{">{</a> </td>
<td nowrap> <a href="#}">}</a> </td>
</tr>
<tr>
<td nowrap> <a href="#}cat">}cat</a> </td>
<td nowrap> <a href="#}dict">}dict</a> </td>
<td nowrap> <a href="#}join">}join</a> </td>
<td nowrap> <a href="#}list">}list</a> </td>
<td nowrap> <a href="#}tell">}tell</a> </td>
</tr>
</table></blockquote>
<h4>A's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#abort">abort</a> </td>
<td nowrap> <a href="#abs">abs</a> </td>
<td nowrap> <a href="#acos">acos</a> </td>
</tr>
<tr>
<td nowrap> <a href="#addpennies">addpennies</a> </td>
<td nowrap> <a href="#addprop">addprop</a> </td>
<td nowrap> <a href="#address?">address?</a> </td>
</tr>
<tr>
<td nowrap> <a href="#and">and</a> </td>
<td nowrap> <a href="#ansi_midstr">ansi_midstr</a> </td>
<td nowrap> <a href="#ansi_strcut">ansi_strcut</a> </td>
</tr>
<tr>
<td nowrap> <a href="#ansi_strip">ansi_strip</a> </td>
<td nowrap> <a href="#ansi_strlen">ansi_strlen</a> </td>
<td nowrap> <a href="#array?">array?</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_appenditem">array_appenditem</a> </td>
<td nowrap> <a href="#array_compare">array_compare</a> </td>
<td nowrap> <a href="#array_count">array_count</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_cut">array_cut</a> </td>
<td nowrap> <a href="#array_delitem">array_delitem</a> </td>
<td nowrap> <a href="#array_delrange">array_delrange</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_diff">array_diff</a> </td>
<td nowrap> <a href="#array_excludeval">array_excludeval</a> </td>
<td nowrap> <a href="#array_explode">array_explode</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_extract">array_extract</a> </td>
<td nowrap> <a href="#array_filter_flags">array_filter_flags</a> </td>
<td nowrap> <a href="#array_filter_prop">array_filter_prop</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_findval">array_findval</a> </td>
<td nowrap> <a href="#array_first">array_first</a> </td>
<td nowrap> <a href="#array_fmtstrings">array_fmtstrings</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_get_ignorelist">array_get_ignorelist</a> </td>
<td nowrap> <a href="#array_get_propdirs">array_get_propdirs</a> </td>
<td nowrap> <a href="#array_get_proplist">array_get_proplist</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_get_propvals">array_get_propvals</a> </td>
<td nowrap> <a href="#array_get_reflist">array_get_reflist</a> </td>
<td nowrap> <a href="#array_getitem">array_getitem</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_getrange">array_getrange</a> </td>
<td nowrap> <a href="#array_insertitem">array_insertitem</a> </td>
<td nowrap> <a href="#array_insertrange">array_insertrange</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_interpret">array_interpret</a> </td>
<td nowrap> <a href="#array_intersect">array_intersect</a> </td>
<td nowrap> <a href="#array_join">array_join</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_keys">array_keys</a> </td>
<td nowrap> <a href="#array_last">array_last</a> </td>
<td nowrap> <a href="#array_make">array_make</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_make_dict">array_make_dict</a> </td>
<td nowrap> <a href="#array_matchkey">array_matchkey</a> </td>
<td nowrap> <a href="#array_matchval">array_matchval</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_ndiff">array_ndiff</a> </td>
<td nowrap> <a href="#array_nested_del">array_nested_del</a> </td>
<td nowrap> <a href="#array_nested_get">array_nested_get</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_nested_set">array_nested_set</a> </td>
<td nowrap> <a href="#array_next">array_next</a> </td>
<td nowrap> <a href="#array_nintersect">array_nintersect</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_notify">array_notify</a> </td>
<td nowrap> <a href="#array_nunion">array_nunion</a> </td>
<td nowrap> <a href="#array_prev">array_prev</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_put_proplist">array_put_proplist</a> </td>
<td nowrap> <a href="#array_put_propvals">array_put_propvals</a> </td>
<td nowrap> <a href="#array_put_reflist">array_put_reflist</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_reverse">array_reverse</a> </td>
<td nowrap> <a href="#array_setitem">array_setitem</a> </td>
<td nowrap> <a href="#array_setrange">array_setrange</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_sort">array_sort</a> </td>
<td nowrap> <a href="#array_sort_indexed">array_sort_indexed</a> </td>
<td nowrap> <a href="#array_union">array_union</a> </td>
</tr>
<tr>
<td nowrap> <a href="#array_vals">array_vals</a> </td>
<td nowrap> <a href="#arrive">arrive</a> </td>
<td nowrap> <a href="#asin">asin</a> </td>
</tr>
<tr>
<td nowrap> <a href="#atan">atan</a> </td>
<td nowrap> <a href="#atan2">atan2</a> </td>
<td nowrap> <a href="#atoi">atoi</a> </td>
</tr>
<tr>
<td nowrap> <a href="#awake?">awake?</a> </td>
</tr>
</table></blockquote>
<h4>B's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#background">background</a> </td>
<td nowrap> <a href="#begin">begin</a> </td>
<td nowrap> <a href="#bg_mode">bg_mode</a> </td>
<td nowrap> <a href="#bitand">bitand</a> </td>
<td nowrap> <a href="#bitor">bitor</a> </td>
<td nowrap> <a href="#bitshift">bitshift</a> </td>
</tr>
<tr>
<td nowrap> <a href="#bitxor">bitxor</a> </td>
<td nowrap> <a href="#blessed?">blessed?</a> </td>
<td nowrap> <a href="#blessprop">blessprop</a> </td>
<td nowrap> <a href="#break">break</a> </td>
<td nowrap> <a href="#breakpoints">breakpoints</a> </td>
</tr>
</table></blockquote>
<h4>C's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#c_button">c_button</a> </td>
<td nowrap> <a href="#c_checkbox">c_checkbox</a> </td>
<td nowrap> <a href="#c_combobox">c_combobox</a> </td>
<td nowrap> <a href="#c_datum">c_datum</a> </td>
</tr>
<tr>
<td nowrap> <a href="#c_edit">c_edit</a> </td>
<td nowrap> <a href="#c_frame">c_frame</a> </td>
<td nowrap> <a href="#c_hrule">c_hrule</a> </td>
<td nowrap> <a href="#c_image">c_image</a> </td>
</tr>
<tr>
<td nowrap> <a href="#c_label">c_label</a> </td>
<td nowrap> <a href="#c_listbox">c_listbox</a> </td>
<td nowrap> <a href="#c_menu">c_menu</a> </td>
<td nowrap> <a href="#c_multiedit">c_multiedit</a> </td>
</tr>
<tr>
<td nowrap> <a href="#c_notebook">c_notebook</a> </td>
<td nowrap> <a href="#c_radiobtn">c_radiobtn</a> </td>
<td nowrap> <a href="#c_scale">c_scale</a> </td>
<td nowrap> <a href="#c_spinner">c_spinner</a> </td>
</tr>
<tr>
<td nowrap> <a href="#c_vrule">c_vrule</a> </td>
<td nowrap> <a href="#call">call</a> </td>
<td nowrap> <a href="#caller">caller</a> </td>
<td nowrap> <a href="#cancall?">cancall?</a> </td>
</tr>
<tr>
<td nowrap> <a href="#ceil">ceil</a> </td>
<td nowrap> <a href="#checkargs">checkargs</a> </td>
<td nowrap> <a href="#checkpassword">checkpassword</a> </td>
<td nowrap> <a href="#clear">clear</a> </td>
</tr>
<tr>
<td nowrap> <a href="#clear_error">clear_error</a> </td>
<td nowrap> <a href="#command">command</a> </td>
<td nowrap> <a href="#compilation">compilation</a> </td>
<td nowrap> <a href="#compile">compile</a> </td>
</tr>
<tr>
<td nowrap> <a href="#compiled?">compiled?</a> </td>
<td nowrap> <a href="#conboot">conboot</a> </td>
<td nowrap> <a href="#concount">concount</a> </td>
<td nowrap> <a href="#condbref">condbref</a> </td>
</tr>
<tr>
<td nowrap> <a href="#condescr">condescr</a> </td>
<td nowrap> <a href="#conhost">conhost</a> </td>
<td nowrap> <a href="#conidle">conidle</a> </td>
<td nowrap> <a href="#connect">connect</a> </td>
</tr>
<tr>
<td nowrap> <a href="#connotify">connotify</a> </td>
<td nowrap> <a href="#contents">contents</a> </td>
<td nowrap> <a href="#contents_array">contents_array</a> </td>
<td nowrap> <a href="#contime">contime</a> </td>
</tr>
<tr>
<td nowrap> <a href="#continue">continue</a> </td>
<td nowrap> <a href="#controls">controls</a> </td>
<td nowrap> <a href="#conuser">conuser</a> </td>
<td nowrap> <a href="#copyobj">copyobj</a> </td>
</tr>
<tr>
<td nowrap> <a href="#copyplayer">copyplayer</a> </td>
<td nowrap> <a href="#cos">cos</a> </td>
<td nowrap> <a href="#ctoi">ctoi</a> </td>
</tr>
</table></blockquote>
<h4>D's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#date">date</a> </td>
<td nowrap> <a href="#dbcmp">dbcmp</a> </td>
<td nowrap> <a href="#dbref">dbref</a> </td>
<td nowrap> <a href="#dbref?">dbref?</a> </td>
</tr>
<tr>
<td nowrap> <a href="#dbtop">dbtop</a> </td>
<td nowrap> <a href="#debug notation">debug notation</a> </td>
<td nowrap> <a href="#debug_line">debug_line</a> </td>
<td nowrap> <a href="#debug_off">debug_off</a> </td>
</tr>
<tr>
<td nowrap> <a href="#debug_on">debug_on</a> </td>
<td nowrap> <a href="#debugger">debugger</a> </td>
<td nowrap> <a href="#debugger_break">debugger_break</a> </td>
<td nowrap> <a href="#debugger_commands">debugger_commands</a> </td>
</tr>
<tr>
<td nowrap> <a href="#depth">depth</a> </td>
<td nowrap> <a href="#desc">desc</a> </td>
<td nowrap> <a href="#descr">descr</a> </td>
<td nowrap> <a href="#descr_array">descr_array</a> </td>
</tr>
<tr>
<td nowrap> <a href="#descr_setuser">descr_setuser</a> </td>
<td nowrap> <a href="#descrboot">descrboot</a> </td>
<td nowrap> <a href="#descrbufsize">descrbufsize</a> </td>
<td nowrap> <a href="#descrcon">descrcon</a> </td>
</tr>
<tr>
<td nowrap> <a href="#descrdbref">descrdbref</a> </td>
<td nowrap> <a href="#descrflush">descrflush</a> </td>
<td nowrap> <a href="#descrhost">descrhost</a> </td>
<td nowrap> <a href="#descridle">descridle</a> </td>
</tr>
<tr>
<td nowrap> <a href="#descriptors">descriptors</a> </td>
<td nowrap> <a href="#descrleastidle">descrleastidle</a> </td>
<td nowrap> <a href="#descrmostidle">descrmostidle</a> </td>
<td nowrap> <a href="#descrnotify">descrnotify</a> </td>
</tr>
<tr>
<td nowrap> <a href="#descrsecure?">descrsecure?</a> </td>
<td nowrap> <a href="#descrtime">descrtime</a> </td>
<td nowrap> <a href="#descruser">descruser</a> </td>
<td nowrap> <a href="#dictionary?">dictionary?</a> </td>
</tr>
<tr>
<td nowrap> <a href="#diff3">diff3</a> </td>
<td nowrap> <a href="#dist3d">dist3d</a> </td>
<td nowrap> <a href="#drop">drop</a> </td>
<td nowrap> <a href="#dup">dup</a> </td>
</tr>
<tr>
<td nowrap> <a href="#dupn">dupn</a> </td>
</tr>
</table></blockquote>
<h4>E's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#else">else</a> </td>
<td nowrap> <a href="#envprop">envprop</a> </td>
<td nowrap> <a href="#envpropstr">envpropstr</a> </td>
<td nowrap> <a href="#epsilon">epsilon</a> </td>
<td nowrap> <a href="#error?">error?</a> </td>
</tr>
<tr>
<td nowrap> <a href="#error_bit">error_bit</a> </td>
<td nowrap> <a href="#error_name">error_name</a> </td>
<td nowrap> <a href="#error_num">error_num</a> </td>
<td nowrap> <a href="#error_str">error_str</a> </td>
<td nowrap> <a href="#event_count">event_count</a> </td>
</tr>
<tr>
<td nowrap> <a href="#event_exists">event_exists</a> </td>
<td nowrap> <a href="#event_send">event_send</a> </td>
<td nowrap> <a href="#event_wait">event_wait</a> </td>
<td nowrap> <a href="#event_waitfor">event_waitfor</a> </td>
<td nowrap> <a href="#execute">execute</a> </td>
</tr>
<tr>
<td nowrap> <a href="#exit">exit</a> </td>
<td nowrap> <a href="#exit?">exit?</a> </td>
<td nowrap> <a href="#exits">exits</a> </td>
<td nowrap> <a href="#exits_array">exits_array</a> </td>
<td nowrap> <a href="#exp">exp</a> </td>
</tr>
<tr>
<td nowrap> <a href="#explode">explode</a> </td>
<td nowrap> <a href="#explode_array">explode_array</a> </td>
</tr>
</table></blockquote>
<h4>F's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#fabs">fabs</a> </td>
<td nowrap> <a href="#fail">fail</a> </td>
<td nowrap> <a href="#fg_mode">fg_mode</a> </td>
<td nowrap> <a href="#findnext">findnext</a> </td>
<td nowrap> <a href="#firstdescr">firstdescr</a> </td>
<td nowrap> <a href="#flag?">flag?</a> </td>
</tr>
<tr>
<td nowrap> <a href="#flags">flags</a> </td>
<td nowrap> <a href="#float">float</a> </td>
<td nowrap> <a href="#float?">float?</a> </td>
<td nowrap> <a href="#floor">floor</a> </td>
<td nowrap> <a href="#fmod">fmod</a> </td>
<td nowrap> <a href="#fmtstring">fmtstring</a> </td>
</tr>
<tr>
<td nowrap> <a href="#for">for</a> </td>
<td nowrap> <a href="#force">force</a> </td>
<td nowrap> <a href="#force_level">force_level</a> </td>
<td nowrap> <a href="#foreach">foreach</a> </td>
<td nowrap> <a href="#foreground">foreground</a> </td>
<td nowrap> <a href="#fork">fork</a> </td>
</tr>
<tr>
<td nowrap> <a href="#frand">frand</a> </td>
<td nowrap> <a href="#ftostr">ftostr</a> </td>
<td nowrap> <a href="#ftostrc">ftostrc</a> </td>
</tr>
</table></blockquote>
<h4>G's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#gaussian">gaussian</a> </td>
<td nowrap> <a href="#getlink">getlink</a> </td>
<td nowrap> <a href="#getlinks">getlinks</a> </td>
<td nowrap> <a href="#getlinks_array">getlinks_array</a> </td>
</tr>
<tr>
<td nowrap> <a href="#getlockstr">getlockstr</a> </td>
<td nowrap> <a href="#getpidinfo">getpidinfo</a> </td>
<td nowrap> <a href="#getpids">getpids</a> </td>
<td nowrap> <a href="#getprop">getprop</a> </td>
</tr>
<tr>
<td nowrap> <a href="#getpropfval">getpropfval</a> </td>
<td nowrap> <a href="#getpropstr">getpropstr</a> </td>
<td nowrap> <a href="#getpropval">getpropval</a> </td>
<td nowrap> <a href="#getseed">getseed</a> </td>
</tr>
<tr>
<td nowrap> <a href="#gmtoffset">gmtoffset</a> </td>
<td nowrap> <a href="#gui-options">gui-options</a> </td>
<td nowrap> <a href="#gui_available">gui_available</a> </td>
<td nowrap> <a href="#gui_ctrl_command">gui_ctrl_command</a> </td>
</tr>
<tr>
<td nowrap> <a href="#gui_ctrl_create">gui_ctrl_create</a> </td>
<td nowrap> <a href="#gui_dlog_close">gui_dlog_close</a> </td>
<td nowrap> <a href="#gui_dlog_create">gui_dlog_create</a> </td>
<td nowrap> <a href="#gui_dlog_helper">gui_dlog_helper</a> </td>
</tr>
<tr>
<td nowrap> <a href="#gui_dlog_show">gui_dlog_show</a> </td>
<td nowrap> <a href="#gui_dlog_simple">gui_dlog_simple</a> </td>
<td nowrap> <a href="#gui_dlog_tabbed">gui_dlog_tabbed</a> </td>
<td nowrap> <a href="#gui_value_get">gui_value_get</a> </td>
</tr>
<tr>
<td nowrap> <a href="#gui_value_set">gui_value_set</a> </td>
<td nowrap> <a href="#gui_values_get">gui_values_get</a> </td>
</tr>
</table></blockquote>
<h4>I's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#if">if</a> </td>
<td nowrap> <a href="#ignore_add">ignore_add</a> </td>
<td nowrap> <a href="#ignore_del">ignore_del</a> </td>
<td nowrap> <a href="#ignoring?">ignoring?</a> </td>
<td nowrap> <a href="#inf">inf</a> </td>
<td nowrap> <a href="#instances">instances</a> </td>
</tr>
<tr>
<td nowrap> <a href="#instr">instr</a> </td>
<td nowrap> <a href="#instring">instring</a> </td>
<td nowrap> <a href="#int">int</a> </td>
<td nowrap> <a href="#int?">int?</a> </td>
<td nowrap> <a href="#interp">interp</a> </td>
<td nowrap> <a href="#intostr">intostr</a> </td>
</tr>
<tr>
<td nowrap> <a href="#is_set?">is_set?</a> </td>
<td nowrap> <a href="#ispid?">ispid?</a> </td>
<td nowrap> <a href="#itoc">itoc</a> </td>
</tr>
</table></blockquote>
<h4>J's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#jmp">jmp</a> </td>
</tr>
</table></blockquote>
<h4>K's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#kill">kill</a> </td>
</tr>
</table></blockquote>
<h4>L's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#lastdescr">lastdescr</a> </td>
<td nowrap> <a href="#ldup">ldup</a> </td>
<td nowrap> <a href="#libraries">libraries</a> </td>
<td nowrap> <a href="#listeners">listeners</a> </td>
<td nowrap> <a href="#loc">loc</a> </td>
</tr>
<tr>
<td nowrap> <a href="#localvar">localvar</a> </td>
<td nowrap> <a href="#location">location</a> </td>
<td nowrap> <a href="#lock?">lock?</a> </td>
<td nowrap> <a href="#locked?">locked?</a> </td>
<td nowrap> <a href="#log">log</a> </td>
</tr>
<tr>
<td nowrap> <a href="#log10">log10</a> </td>
<td nowrap> <a href="#loop-example1">loop-example1</a> </td>
<td nowrap> <a href="#loop-example2">loop-example2</a> </td>
<td nowrap> <a href="#loop-example3">loop-example3</a> </td>
<td nowrap> <a href="#loops">loops</a> </td>
</tr>
<tr>
<td nowrap> <a href="#lreverse">lreverse</a> </td>
<td nowrap> <a href="#lvar">lvar</a> </td>
</tr>
</table></blockquote>
<h4>M's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#match">match</a> </td>
<td nowrap> <a href="#max_variable_count">max_variable_count</a> </td>
<td nowrap> <a href="#mcp_bind">mcp_bind</a> </td>
</tr>
<tr>
<td nowrap> <a href="#mcp_register">mcp_register</a> </td>
<td nowrap> <a href="#mcp_register_event">mcp_register_event</a> </td>
<td nowrap> <a href="#mcp_send">mcp_send</a> </td>
</tr>
<tr>
<td nowrap> <a href="#mcp_supports">mcp_supports</a> </td>
<td nowrap> <a href="#me">me</a> </td>
<td nowrap> <a href="#midstr">midstr</a> </td>
</tr>
<tr>
<td nowrap> <a href="#mlevel">mlevel</a> </td>
<td nowrap> <a href="#mode">mode</a> </td>
<td nowrap> <a href="#modf">modf</a> </td>
</tr>
<tr>
<td nowrap> <a href="#movepennies">movepennies</a> </td>
<td nowrap> <a href="#moveto">moveto</a> </td>
<td nowrap> <a href="#mucker levels">mucker levels</a> </td>
</tr>
<tr>
<td nowrap> <a href="#multitasking">multitasking</a> </td>
</tr>
</table></blockquote>
<h4>N's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#name">name</a> </td>
<td nowrap> <a href="#name-ok?">name-ok?</a> </td>
<td nowrap> <a href="#newexit">newexit</a> </td>
<td nowrap> <a href="#newobject">newobject</a> </td>
</tr>
<tr>
<td nowrap> <a href="#newpassword">newpassword</a> </td>
<td nowrap> <a href="#newplayer">newplayer</a> </td>
<td nowrap> <a href="#newprogram">newprogram</a> </td>
<td nowrap> <a href="#newroom">newroom</a> </td>
</tr>
<tr>
<td nowrap> <a href="#next">next</a> </td>
<td nowrap> <a href="#nextdescr">nextdescr</a> </td>
<td nowrap> <a href="#nextentrance">nextentrance</a> </td>
<td nowrap> <a href="#nextowned">nextowned</a> </td>
</tr>
<tr>
<td nowrap> <a href="#nextprop">nextprop</a> </td>
<td nowrap> <a href="#not">not</a> </td>
<td nowrap> <a href="#notify">notify</a> </td>
<td nowrap> <a href="#notify_except">notify_except</a> </td>
</tr>
<tr>
<td nowrap> <a href="#notify_exclude">notify_exclude</a> </td>
<td nowrap> <a href="#number?">number?</a> </td>
</tr>
</table></blockquote>
<h4>O's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#objmem">objmem</a> </td>
<td nowrap> <a href="#odrop">odrop</a> </td>
<td nowrap> <a href="#ofail">ofail</a> </td>
<td nowrap> <a href="#ok?">ok?</a> </td>
<td nowrap> <a href="#online">online</a> </td>
</tr>
<tr>
<td nowrap> <a href="#online_array">online_array</a> </td>
<td nowrap> <a href="#or">or</a> </td>
<td nowrap> <a href="#osucc">osucc</a> </td>
<td nowrap> <a href="#over">over</a> </td>
<td nowrap> <a href="#owner">owner</a> </td>
</tr>
</table></blockquote>
<h4>P's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#parselock">parselock</a> </td>
<td nowrap> <a href="#parseprop">parseprop</a> </td>
<td nowrap> <a href="#parsepropex">parsepropex</a> </td>
<td nowrap> <a href="#part_pmatch">part_pmatch</a> </td>
</tr>
<tr>
<td nowrap> <a href="#pennies">pennies</a> </td>
<td nowrap> <a href="#pi">pi</a> </td>
<td nowrap> <a href="#pick">pick</a> </td>
<td nowrap> <a href="#pid">pid</a> </td>
</tr>
<tr>
<td nowrap> <a href="#player?">player?</a> </td>
<td nowrap> <a href="#pmatch">pmatch</a> </td>
<td nowrap> <a href="#pname-ok?">pname-ok?</a> </td>
<td nowrap> <a href="#polar_to_xyz">polar_to_xyz</a> </td>
</tr>
<tr>
<td nowrap> <a href="#pop">pop</a> </td>
<td nowrap> <a href="#popn">popn</a> </td>
<td nowrap> <a href="#pow">pow</a> </td>
<td nowrap> <a href="#pr_mode">pr_mode</a> </td>
</tr>
<tr>
<td nowrap> <a href="#preempt">preempt</a> </td>
<td nowrap> <a href="#prettylock">prettylock</a> </td>
<td nowrap> <a href="#prog">prog</a> </td>
<td nowrap> <a href="#program?">program?</a> </td>
</tr>
<tr>
<td nowrap> <a href="#program_getlines">program_getlines</a> </td>
<td nowrap> <a href="#program_setlines">program_setlines</a> </td>
<td nowrap> <a href="#pronoun_sub">pronoun_sub</a> </td>
<td nowrap> <a href="#propdir?">propdir?</a> </td>
</tr>
<tr>
<td nowrap> <a href="#public">public</a> </td>
<td nowrap> <a href="#put">put</a> </td>
</tr>
</table></blockquote>
<h4>Q's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#queue">queue</a> </td>
</tr>
</table></blockquote>
<h4>R's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#random">random</a> </td>
<td nowrap> <a href="#read">read</a> </td>
<td nowrap> <a href="#read_wants_blanks">read_wants_blanks</a> </td>
<td nowrap> <a href="#recycle">recycle</a> </td>
</tr>
<tr>
<td nowrap> <a href="#reflist_add">reflist_add</a> </td>
<td nowrap> <a href="#reflist_del">reflist_del</a> </td>
<td nowrap> <a href="#reflist_find">reflist_find</a> </td>
<td nowrap> <a href="#regexp">regexp</a> </td>
</tr>
<tr>
<td nowrap> <a href="#regsub">regsub</a> </td>
<td nowrap> <a href="#remove_prop">remove_prop</a> </td>
<td nowrap> <a href="#repeat">repeat</a> </td>
<td nowrap> <a href="#reverse">reverse</a> </td>
</tr>
<tr>
<td nowrap> <a href="#rinstr">rinstr</a> </td>
<td nowrap> <a href="#rinstring">rinstring</a> </td>
<td nowrap> <a href="#rmatch">rmatch</a> </td>
<td nowrap> <a href="#room?">room?</a> </td>
</tr>
<tr>
<td nowrap> <a href="#rot">rot</a> </td>
<td nowrap> <a href="#rotate">rotate</a> </td>
<td nowrap> <a href="#round">round</a> </td>
<td nowrap> <a href="#rsplit">rsplit</a> </td>
</tr>
</table></blockquote>
<h4>S's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#set">set</a> </td>
<td nowrap> <a href="#set_error">set_error</a> </td>
<td nowrap> <a href="#setdesc">setdesc</a> </td>
<td nowrap> <a href="#setdrop">setdrop</a> </td>
</tr>
<tr>
<td nowrap> <a href="#setfail">setfail</a> </td>
<td nowrap> <a href="#setlink">setlink</a> </td>
<td nowrap> <a href="#setlinks_array">setlinks_array</a> </td>
<td nowrap> <a href="#setlockstr">setlockstr</a> </td>
</tr>
<tr>
<td nowrap> <a href="#setmode">setmode</a> </td>
<td nowrap> <a href="#setname">setname</a> </td>
<td nowrap> <a href="#setodrop">setodrop</a> </td>
<td nowrap> <a href="#setofail">setofail</a> </td>
</tr>
<tr>
<td nowrap> <a href="#setosucc">setosucc</a> </td>
<td nowrap> <a href="#setown">setown</a> </td>
<td nowrap> <a href="#setprop">setprop</a> </td>
<td nowrap> <a href="#setseed">setseed</a> </td>
</tr>
<tr>
<td nowrap> <a href="#setsucc">setsucc</a> </td>
<td nowrap> <a href="#setsysparm">setsysparm</a> </td>
<td nowrap> <a href="#sign">sign</a> </td>
<td nowrap> <a href="#sin">sin</a> </td>
</tr>
<tr>
<td nowrap> <a href="#sleep">sleep</a> </td>
<td nowrap> <a href="#smatch">smatch</a> </td>
<td nowrap> <a href="#split">split</a> </td>
<td nowrap> <a href="#sqrt">sqrt</a> </td>
</tr>
<tr>
<td nowrap> <a href="#srand">srand</a> </td>
<td nowrap> <a href="#stats">stats</a> </td>
<td nowrap> <a href="#stod">stod</a> </td>
<td nowrap> <a href="#strcat">strcat</a> </td>
</tr>
<tr>
<td nowrap> <a href="#strcmp">strcmp</a> </td>
<td nowrap> <a href="#strcut">strcut</a> </td>
<td nowrap> <a href="#strdecrypt">strdecrypt</a> </td>
<td nowrap> <a href="#strencrypt">strencrypt</a> </td>
</tr>
<tr>
<td nowrap> <a href="#string?">string?</a> </td>
<td nowrap> <a href="#stringcmp">stringcmp</a> </td>
<td nowrap> <a href="#stringpfx">stringpfx</a> </td>
<td nowrap> <a href="#strip">strip</a> </td>
</tr>
<tr>
<td nowrap> <a href="#striplead">striplead</a> </td>
<td nowrap> <a href="#striptail">striptail</a> </td>
<td nowrap> <a href="#strlen">strlen</a> </td>
<td nowrap> <a href="#strncmp">strncmp</a> </td>
</tr>
<tr>
<td nowrap> <a href="#strtof">strtof</a> </td>
<td nowrap> <a href="#subst">subst</a> </td>
<td nowrap> <a href="#succ">succ</a> </td>
<td nowrap> <a href="#swap">swap</a> </td>
</tr>
<tr>
<td nowrap> <a href="#sysparm">sysparm</a> </td>
<td nowrap> <a href="#sysparm_array">sysparm_array</a> </td>
<td nowrap> <a href="#systime">systime</a> </td>
<td nowrap> <a href="#systime_precise">systime_precise</a> </td>
</tr>
</table></blockquote>
<h4>T's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#tan">tan</a> </td>
<td nowrap> <a href="#testlock">testlock</a> </td>
<td nowrap> <a href="#textattr">textattr</a> </td>
<td nowrap> <a href="#then">then</a> </td>
<td nowrap> <a href="#thing?">thing?</a> </td>
<td nowrap> <a href="#time">time</a> </td>
</tr>
<tr>
<td nowrap> <a href="#timefmt">timefmt</a> </td>
<td nowrap> <a href="#timer_start">timer_start</a> </td>
<td nowrap> <a href="#timer_stop">timer_stop</a> </td>
<td nowrap> <a href="#timesplit">timesplit</a> </td>
<td nowrap> <a href="#timestamps">timestamps</a> </td>
<td nowrap> <a href="#toadplayer">toadplayer</a> </td>
</tr>
<tr>
<td nowrap> <a href="#tokensplit">tokensplit</a> </td>
<td nowrap> <a href="#tolower">tolower</a> </td>
<td nowrap> <a href="#toupper">toupper</a> </td>
<td nowrap> <a href="#tread">tread</a> </td>
<td nowrap> <a href="#trig">trig</a> </td>
<td nowrap> <a href="#trigger">trigger</a> </td>
</tr>
<tr>
<td nowrap> <a href="#truename">truename</a> </td>
<td nowrap> <a href="#try">try</a> </td>
</tr>
</table></blockquote>
<h4>U's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#unblessprop">unblessprop</a> </td>
<td nowrap> <a href="#uncompile">uncompile</a> </td>
<td nowrap> <a href="#unparselock">unparselock</a> </td>
<td nowrap> <a href="#unparseobj">unparseobj</a> </td>
<td nowrap> <a href="#until">until</a> </td>
<td nowrap> <a href="#userlog">userlog</a> </td>
</tr>
</table></blockquote>
<h4>V's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#var">var</a> </td>
<td nowrap> <a href="#var!">var!</a> </td>
<td nowrap> <a href="#variable">variable</a> </td>
<td nowrap> <a href="#version">version</a> </td>
</tr>
</table></blockquote>
<h4>W's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#watchpid">watchpid</a> </td>
<td nowrap> <a href="#while">while</a> </td>
<td nowrap> <a href="#wizcall">wizcall</a> </td>
</tr>
</table></blockquote>
<h4>X's</h4><blockquote><table border=0>
<tr>
<td nowrap> <a href="#xor">xor</a> </td>
<td nowrap> <a href="#xyz_to_polar">xyz_to_polar</a> </td>
</tr>
</table></blockquote>
<p>
<p><hr size=6>
<h3><a name="DefDets">Details and Definitions</a></h3>
<blockquote><table border=0>
<tr>
<td width="20%"> <a href="#arrive">arrive</a> </td>
<td width="20%"> <a href="#compilation">compilation</a> </td>
<td width="20%"> <a href="#connect">connect</a> </td>
<td width="20%"> <a href="#flags">flags</a> </td>
<td width="20%"> <a href="#libraries">libraries</a> </td>
</tr>
<tr>
<td width="20%"> <a href="#listeners">listeners</a> </td>
<td width="20%"> <a href="#mucker levels">mucker levels</a> </td>
<td width="20%"> <a href="#multitasking">multitasking</a> </td>
</tr>
</table></blockquote>
<hr><h4><a name="mucker levels">Mucker Levels:
<br>
</a></h4>
<p>
There are now four levels of MUCKERs in fb4.0. Level zero is a
non-mucker. They cannot use the editor, and MUF programs owned by them
cannot be run.
<p>
<p>
Level one MUCKER's are apprentices. Their powers are restricted as they
cannot get information about any object that is not in the same room they
are. ie: OWNER, NAME, LOCATION, etc all fail if the object isn't in the
same room as the player. Level one MUCKER programs always run as if they
are set SETUID. NOTIFY, NOTIFY_EXCEPT, and NOTIFY_EXCLUDE will refuse to
send messages to rooms the user is not in. Level one programs cannot use
ADDPENNIES. Level one programs don't list DARK objects or rooms in the
contents of a room, unless they are controlled by the program owner.
Additionally, level one programs have an absolute instruction limit that
is the same size as the PREEMPT instruction limit. This is usually
around 20,000 instructions.
<p>
<p>
Level two MUCKERs are also called Journeymen. Their permissions are
equivalent to the permissions for a normal MUCKER under older versions
of the server. Level two programs can run as many as four times the
number of instructions that a preempt program could. This is usually
around 80,000 instructions.
<p>
<p>
Level three MUCKERs are referred to as Masters. They can use the con-
nection info primitives (ie: CONDBREF, ONLINE, etc.), read the EXITS list
of any room, use NEXTPROP on objects, can use NEWROOM, NEWOBJECT, NEWEXIT,
and COPYOBJ without limitations, can use QUEUE and KILL, and can override
the permissions restrictions of MOVETO. You only give a player MUCKER
level 3 if they are very trusted. There is no absolute instruction count
limit for level three or above, except for programs running in PREEMPT mode.
<p>
<p>
A player who is wizbitted is effectively Mucker Level 4. MUCKER level
four is required for the RECYCLE primitive, the CONHOST primitive, the
FORCE primitive, and the SETOWN primitive. ML4 also allows overriding
of permissions of the SET* primitives, and property permissions. Props
not listed by NEXTPROP with ML3 are listed with ML4. Programs running
ML4 do not even have instruction limits on PREEMPT mode programs.
<p>
<p>
The MUCKER level permissions that a program runs at is the lesser of
it's own MUCKER level and the MUCKER level of it's owner. If it is
owned by a player who is MUCKER level 2, and it is MUCKER level 3,
then it runs at Mucker level 2. The one exception to this is programs
owned by a Wizard player. They run at Mucker level 2 if the program
itself is not wizbit, and at Mucker level 4 if the program IS set wizbit.
<p>
<p>
Mucker level is referred to in flags lists by M# where the # is the
Mucker level. Level zero objects don't show a flag for it. Example:
<pre>
Revar(#37PM3)
</pre>
<p>
In verbose flags lists, Mucker levels greater than zero are shown
by MUCKER# where # is the mucker level.
<p>
<p>
To set a level on a player or program, use the level number as the
flag name. MUCKER is the same as 2, and !MUCKER is the same as 0.
Example:
<pre>
@set Revar=2
</pre>
<p>
A player may set the MUCKER level on a program they own to any level
lower than or equal to their own level, and a wizard may set a program
or player to any MUCKER level. When a program is created, it is
automatically set to the same MUCKER level as the creating player.
When a program is loaded from an old db, if it is Mucker Level 0,
it is upgraded to Mucker Level 2.
<p>
<hr><h4><a name="multitasking">Multitasking:
<br>
<br>
</a></h4>
There are 3 modes that a program can be in when running: foreground,
background, and preempt. A program running in the foreground lets other
users and programs have timeslices (ie multitasking), but blocks input
from the program user. Background mode allows the user to also go on and
do other things and issue other commands, but will not allow the program
to do READs. Preempt mode means that the program runs to completion
without multitasking, taking full control of the interpreter and not
letting other users or progs have timeslices, but imposes an instruction
count limit unless the program is a wizard program.
<p>
Programs run by @locks, @descs, @succs, @fails, and @drops default to the
preempt mode when they run. Programs run by actions linked to them
default to running in foreground mode. QUEUEd program events, such as
those set up by _listen, _connect, _disconnect, etc, and those QUEUEd by
other programs default to running in background mode. (NOTE: these
programs cannot be changed out of background mode)
<p><h5>Also see:
<a href="#foreground">FOREGROUND</a>,
<a href="#background">BACKGROUND</a>,
<a href="#preempt">PREEMPT</a>,
<a href="#fork">FORK</a>,
<a href="#queue">QUEUE</a>,
<a href="#kill">KILL</a> and
<a href="#sleep">SLEEP</a>
</h5>
<p>
<hr><h4><a name="libraries">Libraries:
<br>
<br>
How to use a library:
<br>
<pre>
</a></h4>
1) Use "@register lib" to list what libraries exist.
2) Use "@view $lib/<libraryname>" to list the docs on that library.
3) When you've found the library and the function you want, then all
you have to do in your program is, at the beginning of it,
$include $lib/<libraryname>
then just use the function name to invoke it later in your program
and it will run as if it were a function in your program.
</pre>
How to make a library:
<pre>
1) Create a program with several useful generic subroutines.
2) DOCUMENT those subroutines in a commented out header in the prog.
3) @set <program>=_docs:<command to list those DOCS you made>
4) Set the version number of the code in the library with $version 1.000
This lets you keep track of the code revision installed, separately
from the version of the library calling API.
5) Set the library API version number with $lib-version 1.000
This is the version of the calling interface for this library.
Remember to up this version when you change this library's calls.
Remember that 1.19 is less than 1.2, so use numbers like 1.002.
6) For each function you want to be externally callable, do the following:
a) Declare it PUBLIC
b) Create the caller macro with either:
$libdef FUNCNAME or
$pubdef EXPORTEDNAME "$lib/THISLIB" match "FUNCNAME" call
7) Make sure the program is set LINK_OK and VIEWABLE.
8) Globally register the program with the @register command with a
prefix of "lib/". ie: @reg lib-strings.muf=lib/strings
9) You're done!
</pre>
Currently standard libraries:
<pre>
$lib/strings Functions for manipulating strings.
$lib/props Routines for searching for properties, or setting them.
$lib/lmgr Standard list manager routines.
$lib/stackrng Routines to handle variable sized ranges on the stack.
$lib/edit String range editing and manipulation routines.
$lib/editor Standard user text editor.
$lib/mesg Standard message manager routines.
$lib/mesgbox Routines for handling lists of messages.
$lib/match Object or string matching routines.
$lib/reflist Dbref-list management routines.
$lib/index Hashed linked list manager with partial key matching.
$lib/gui Routines to make MCP's GUI package easier to use.
$lib/optionsgui Given datums, auto-generates a GUI to edit them.
</pre>
<p>
<hr><h4><a name="flags">Flags that have importance to MUF:
<br>
<br>
</a></h4>
If a program is set DARK (DEBUG), then when it is run, it will print out
a stack trace for each instruction executed, to the player running the
program. This is useful for debugging programs.
If a program is set ZOMBIE, then when the owner runs it, they will enter an
interactive debugger, useful for following a program as it runs and
changing it to see what different situations do.
On dbload, if a program is set ABODE (AUTOSTART), *AND* it is owned by
a wizard, then it will be placed in the timequeue with a delay of 0 and
a string parm of "Startup". Autostart programs run with the location
NOTHING (#-1) rather than the location of the owner of the program.
If a program has the HAVEN flag set on it (HARDUID) then it runs with
the uid and permissions of the owner of the trigger of the program.
If the program is a timequeue event with trigger of #-1, then it
will run with the permissions and uid of the program owner as in SETUID.
If a program is set both SETUID and HARDUID, and it is owned by a wizard,
then it inherits the uid and mucker level of the program that called it.
If it was not called by a program, then it runs SETUID. This is useful
for writing libraries.
Programs set BUILDER (BOUND) run in preempt mode, regardless of the mode
of the program. ie: a foreground program, while running in a program set
BOUND, will run pre-empt, with the multitasking effectively shut off.
A program that is set WIZARD ignores almost all permissions checking.
The Mucker Level of the program also has a great deal of influence on what
a program can and cannot do. See MUCKER LEVELS for more information.
<p><h5>Also see:
<a href="#debugger">DEBUGGER</a>
</h5>
<p>
<hr><h4><a name="compilation">Compilation:
<br>
<br>
</a></h4>
Programs are compiled when they are run or called, or when explicitly
compiled in the editor. They are compiled with the uid of the owner of
the program. After being unused for a number of minutes, programs will
be removed from memory until needed again.
<p>
<hr><h4><a name="listeners">Listeners:
<br>
<br>
</a></h4>
When a message is notify_except'ed or notify_exclude'ed to a room, and
LISTENERS and LISTENERS_ENV are defined, then it will run ALL the programs
referred to in all the _listen properties down the environment tree, And
in all of the objects in the room with LISTENERS_OBJ defined. Also, the
muf NOTIFY primitive was changed to run the _listen program on an object
or player if a message is sent to them that way.
<p>
<hr><h4><a name="connect">Connect and Disconnect Propqueues:
<br>
<br>
</a></h4>
A room or player may have a "_connect" property set that contains the
dbref of a program to run when a player connects. The program must be
either link_ok or must be owned by the player connecting. When the
program is run, the string on the stack will be "Connect", the "loc @"
will be the location of the connecting player, the "me @" will be the
connecting player, and the "trigger @" (and "trig") will be the object
that had the _connect property on it. All programs referred to by
_connect properties on the player, and on rooms down the environment tree
from the player, will be run. When a player disconnects, programs referred
to by _disconnect properties will be run in a similar manner.
(connect and disconnect _actions_ are also triggered.)
<p>
<hr><h4><a name="arrive">Arrive and Depart Propqueues:
<br>
<br>
</a></h4>
Programs referred to by props in _depart/_arrive propdirs will all be
run when a player leaves or enters a room, respectively. An example would
be _arrive/announce:1234 That would queue up program #1234 when a player
enters a room. The name ("announce") is not important, and can be anything
you want, but they are run in alphabetic order.
<p>
<p><hr size=6>
<h3><a name="CompDefs">Macros and Compiler Directives</a></h3>
<blockquote><table border=0>
<tr>
<td width="33%"> <a href="#$abort">$abort</a> </td>
<td width="33%"> <a href="#$author">$author</a> </td>
<td width="33%"> <a href="#$cleardefs">$cleardefs</a> </td>
</tr>
<tr>
<td width="33%"> <a href="#$def">$def</a> </td>
<td width="33%"> <a href="#$define">$define</a> </td>
<td width="33%"> <a href="#$echo">$echo</a> </td>
</tr>
<tr>
<td width="33%"> <a href="#$ifcancall">$ifcancall</a> </td>
<td width="33%"> <a href="#$ifdef">$ifdef</a> </td>
<td width="33%"> <a href="#$iflib">$iflib</a> </td>
</tr>
<tr>
<td width="33%"> <a href="#$iflibver">$iflibver</a> </td>
<td width="33%"> <a href="#$ifncancall">$ifncancall</a> </td>
<td width="33%"> <a href="#$ifndef">$ifndef</a> </td>
</tr>
<tr>
<td width="33%"> <a href="#$ifnlib">$ifnlib</a> </td>
<td width="33%"> <a href="#$ifnlibver">$ifnlibver</a> </td>
<td width="33%"> <a href="#$ifnver">$ifnver</a> </td>
</tr>
<tr>
<td width="33%"> <a href="#$ifver">$ifver</a> </td>
<td width="33%"> <a href="#$include">$include</a> </td>
<td width="33%"> <a href="#$lib-version">$lib-version</a> </td>
</tr>
<tr>
<td width="33%"> <a href="#$libdef">$libdef</a> </td>
<td width="33%"> <a href="#$note">$note</a> </td>
<td width="33%"> <a href="#$pragma">$pragma</a> </td>
</tr>
<tr>
<td width="33%"> <a href="#$pubdef">$pubdef</a> </td>
<td width="33%"> <a href="#$undef">$undef</a> </td>
<td width="33%"> <a href="#$version">$version</a> </td>
</tr>
<tr>
<td width="33%"> <a href="#\">\</a> </td>
<td width="33%"> <a href="#__fuzzball__">__fuzzball__</a> </td>
<td width="33%"> <a href="#__muckname">__muckname</a> </td>
</tr>
<tr>
<td width="33%"> <a href="#__version">__version</a> </td>
<td width="33%"> <a href="#max_variable_count">max_variable_count</a> </td>
</tr>
</table></blockquote>
<hr><h4><a name="__fuzzball__">__FUZZBALL__
<br>
<br>
</a></h4>
A pre$defined macro that contains the value 1 on a FuzzBall Muck server.
This is useful for server-type specific $ifdefs, when code needs to be
different on, say, FuzzBall Mucks and ProtoMucks. For example:
<pre>
$ifdef __fuzzball__
me @ "This is a FuzzBall Muck server.!" notify
$endif
</pre>
<p>
<hr><h4><a name="__muckname">__MUCKNAME
<br>
<br>
</a></h4>
A pre$defined macro that contains the name of the server's muckname @tune
parameter value. This is useful for muck specific $ifdefs. For example:
<pre>
$ifdef __muckname=FurryMUCK
me @ "Helloooooo Furry!" notify
$endif
</pre>
<p>
<hr><h4><a name="__version">__VERSION
<br>
<br>
</a></h4>
A pre$defined macro that contains the current server version. Contains
the same string that the VERSION primitive returns. This is mainly useful
in $ifdef/$ifndef comparisons. The value of this will always start with
'Muck2.2fb' for historical reasons, followed by the current fbmuck server
version. Ie: Muck2.2fb6.00 for the 6.00 fbmuck server.
<p><h5>Also see:
<a href="#version">VERSION</a>,
<a href="#$ifdef">$IFDEF</a>,
<a href="#$define">$DEFINE</a> and
<a href="#$def">$DEF</a>
</h5>
<p>
<hr><h4><a name="max_variable_count">MAX_VARIABLE_COUNT
<br>
<br>
</a></h4>
A pre$defined macro that expands to the maximum number of variables of
each type allowed in a program. For function-scoped variables, this is the
max number of scoped vars that each function may have.
<p>
<hr><h4><a name="$author">$AUTHOR <rest_of_line>
<br>
<br>
</a></h4>
Sets the _author string property on the program to <rest_of_line>.
The preferred format is an email address with name comment. ie:
<pre>
$author Revar Desmera <revar@belfry.com>
</pre>
To denote multiple authors, separate them with commas. ie:
<pre>
$author Revar Desmera <revar@belfry.com>, Foxen <foxen@belfry.com>
</pre>
If you don't want to include your email address, just omit it. ie:
<pre>
$author Revar, Foxen
</pre>
<p>
<hr><h4><a name="$version">$VERSION <float>
<br>
<br>
</a></h4>
Sets the _version string property on the program to <float>. Version
numbers should be like 1.009 and 1.010, so that they can be compared using
floating point comparisons. (Remember, 1.9 is greater than 1.10.)
<p>
<hr><h4><a name="$lib-version">$LIB-VERSION <float>
<br>
<br>
</a></h4>
Sets the _lib-version string property on the program to <float>. Version
numbers should be like 1.009 and 1.010, so that they can be compared using
floating point comparisons. (Remember, 1.9 is greater than 1.10.)
<p>
<hr><h4><a name="$note">$NOTE <rest_of_line>
<br>
<br>
</a></h4>
Sets the _note string property on the program to <rest_of_line>.
<p>
<hr><h4><a name="$define">$DEFINE <defname> <definition> $enddef
<br>
<br>
</a></h4>
Basically the same as C's #define <defname> <definition>
<p>
<hr><h4><a name="$def">$DEF <defname> <definition>
<br>
<br>
</a></h4>
This is the same as $define, except that the definition stops at the end
of the program line, without using an ending $enddef.
<p>
<hr><h4><a name="$undef">$UNDEF <defname>
<br>
<br>
</a></h4>
About the same as C's #undef <defname>
<p>
<hr><h4><a name="$include">$INCLUDE $<libname>
<br>
$INCLUDE <dbref>
<br>
<br>
</a></h4>
Sets a bunch of $defines from the properties in the /_defs/ propdir of the
given program. For example, if object #345 had the following properties:
<pre>
/_defs/desc: "_/de" getpropstr
/_defs/setpropstr: dup if 0 addprop else pop remove_prop then
/_defs/setpropval: dup if "" swap addprop else pop remove_prop then
/_defs/setprop: dup int? if setpropval else setpropstr then
</pre>
then if a program contained '$include #345' in it, then all subsequent
references to 'desc', 'setpropstr', 'setpropval', and 'setprop' would
be expanded to the string values of their respective programs. For example,
'desc' would be replaced throughout the program with '"_/de" getpropstr'
NOTE: You cannot have a slash in a definition name. ie: The property
<pre>
_defs/a/b:foo
</pre>
will NOT make a definition named a/b.
<p><h5>Also see:
<a href="#$define">$DEFINE</a>,
<a href="#$def">$DEF</a>,
<a href="#$cleardefs">$CLEARDEFS</a>,
<a href="#$ifdef">$IFDEF</a>,
<a href="#public">PUBLIC</a>,
<a href="#wizcall">WIZCALL</a>,
<a href="#$pubdef">$PUBDEF</a> and
<a href="#$libdef">$LIBDEF</a>
</h5>
<p>
<hr><h4><a name="$pubdef">$PUBDEF :
<br>
$PUBDEF <defname>
<br>
$PUBDEF <defname> <rest_of_line>
<br>
$PUBDEF \<defname> <rest_of_line>
<br>
<br>
</a></h4>
By using this directive, the _defs/ directory on a MUF program can
be set at compile time.
<pre>
$pubdef : Clears the _defs/ propdir on the program.
$pubdef <defname> Clears the _defs/<defname> prop on the prog.
$pubdef <defname> <rest_of_line> Sets _defs/<defname> prop to <rest_of_line>.
$pubdef \<defname> <rest_of_line> Sets _def/<defname> if not already set.
</pre>
For example:
<pre>
$pubdef tell me @ swap notify
</pre>
would put a property named '_defs/tell' on the program object, with the
value 'me @ swap notify'. Def names cannot have ':' nor '/' in them.
<p><h5>Also see:
<a href="#$libdef">$LIBDEF</a>,
<a href="#public">PUBLIC</a>,
<a href="#wizcall">WIZCALL</a>,
<a href="#cancall?">CANCALL?</a> and
<a href="#call">CALL</a>
</h5>
<p>
<hr><h4><a name="$libdef">$LIBDEF <function>
<br>
$LIBDEF \<function>
<br>
<br>
</a></h4>
Sets up an _defs/ prop on the program to call the specified function.
For example:
<pre>
$libdef myfunc
</pre>
would put a prop named '_defs/myfunc' on the program object, with the
value '<this_programs_dbref> "myfunc" call'
<p><h5>Also see:
<a href="#$pubdef">$PUBDEF</a>,
<a href="#public">PUBLIC</a>,
<a href="#wizcall">WIZCALL</a>,
<a href="#cancall?">CANCALL?</a> and
<a href="#call">CALL</a>
</h5>
<p>
<hr><h4><a name="$cleardefs">$CLEARDEFS [ALL]
<br>
<br>
</a></h4>
Ignores program _defs/ when compiling the program. Wizards programs can
use '$cleardefs ALL' to also ignore #0 _defs/ when compiling. This does
not affect macros, and internal _defs/ are always loaded no matter what.
<p><h5>Also see:
<a href="#$define">$DEFINE</a>,
<a href="#$def">$DEF</a> and
<a href="#$undef">$UNDEF</a>
</h5>
<p>
<hr><h4><a name="$ifdef">$IFDEF <condition> <compile if true> $endif
<br>
$IFDEF <condition> <compile if true> $else <compile if false> $endif
<br>
<br>
</a></h4>
This determines whether or not to compile optional sections of code,
depending on the existence of or value of certain $defined names.
The four accepted forms of the <condition> argument are:
<pre>
DEFNAME Is true if DEFNAME was $defined earlier, whatever the value.
DEFNAME=VALUE Is true if DEFNAME exists and its value equals VALUE.
DEFNAME>VALUE Is true if DEFNAME exists and is greater than VALUE.
DEFNAME<VALUE Is true if DEFNAME exists and is less than VALUE.
</pre>
<p>
The semantics of greater than and less than is the same as that used by
the strcmp string comparison command. There must be no spaces between the
DEFNAME, comparator, and VALUE. They must be run together as one word.
<p>
There is no >= or <= comparator available, so to make such a comparison
you need to use $ifndef with the opposite comparator. Ie, to check if
FOO is greater than or equal to 3, use:
<pre>
$ifndef FOO<3
BAR
$enddef
</pre>
Compiler directives are nestable also. For examples:
<pre>
$ifdef __version>Muck2.2fb3.5
$def envprop .envprop
$endif
$define ploc
$ifdef proplocs
.proploc
$else
owner
$endif
$enddef
</pre>
<p><h5>Also see:
<a href="#$ifndef">$IFNDEF</a>,
<a href="#$define">$DEFINE</a>,
<a href="#$def">$DEF</a> and
<a href="#$def">$DEF</a>
</h5>
<p>
<hr><h4><a name="$ifndef">$IFNDEF <condition> <compile if false> $endif
<br>
$IFNDEF <condition> <compile if false> $else <compile if true> $endif
<br>
<br>
</a></h4>
This determines whether or not to compile optional sections of code,
depending on the non-existence of or value of $defined names. $ifndef is
short for 'If NOT Defined' or 'If Not', so it compiles the first code
branch (before the optional $else), only if the <condition> is false.
The four accepted forms of the <condition> argument are:
<pre>
DEFNAME Is true if DEFNAME was $defined earlier, whatever the value.
DEFNAME=VALUE Is true if DEFNAME exists and its value equals VALUE.
DEFNAME>VALUE Is true if DEFNAME exists and is greater than VALUE.
DEFNAME<VALUE Is true if DEFNAME exists and is less than VALUE.
</pre>
The semantics of greater than and less than is the same as that used by the
strcmp string comparison command. There must be no spaces between the
DEFNAME, comparator, and VALUE. They must be run together as one word.
<p><h5>Also see:
<a href="#$ifdef">$IFDEF</a>,
<a href="#$define">$DEFINE</a>,
<a href="#$def">$DEF</a> and
<a href="#$def">$DEF</a>
</h5>
<p>
<hr><h4><a name="$ifver">$IFVER this <float> <truebranch> $endif
<br>
$IFVER this <float> <truebranch> $else <falsebranch> $endif
<br>
$IFVER $<libname> <float> <truebranch> $endif
<br>
$IFVER $<libname> <float> <truebranch> $else <falsebranch> $endif
<br>
$IFVER <dbref> <float> <truebranch> $endif
<br>
$IFVER <dbref> <float> <truebranch> $else <falsebranch> $endif
<br>
<br>
</a></h4>
This determines whether or not to compile optional sections of code,
depending on the $version of the given program, which is stored in its
'_version' property. In the form '$ifver this' then this checks this
compiling program's $version. Otherwise, this checks the $version of
the program referenced by $regname or #dbref.
<p>
The <truebranch> will be compiled if the given program's $version
is greater than or equal to the given <float>, using a floating point
number comparison. Otherwise, the <falsebranch>, if given, will be
compiled.
<p><h5>Also see:
<a href="#$ifnver">$IFNVER</a>,
<a href="#$iflibver">$IFLIBVER</a>,
<a href="#$ifdef">$IFDEF</a>,
<a href="#$version">$VERSION</a> and
<a href="#$lib-version">$LIB-VERSION</a>
</h5>
<p>
<hr><h4><a name="$ifnver">$IFNVER this <float> <truebranch> $endif
<br>
$IFNVER this <float> <truebranch> $else <falsebranch> $endif
<br>
$IFNVER $<libname> <float> <truebranch> $endif
<br>
$IFNVER $<libname> <float> <truebranch> $else <falsebranch> $endif
<br>
$IFNVER <dbref> <float> <truebranch> $endif
<br>
$IFNVER <dbref> <float> <truebranch> $else <falsebranch> $endif
<br>
<br>
</a></h4>
This determines whether or not to compile optional sections of code,
depending on the $version of the given program, which is stored in its
'_version' property. In the form '$ifnver this' then this checks this
compiling program's $version. Otherwise, this checks the $version of
the program referenced by $regname or #dbref.
<p>
The <truebranch> will be compiled if the given program's $version
is less than the given <float>, using a floating point number comparison.
Otherwise, the <falsebranch>, if given, will be compiled.
<p><h5>Also see:
<a href="#$ifver">$IFVER</a>,
<a href="#$iflibver">$IFLIBVER</a>,
<a href="#$ifdef">$IFDEF</a>,
<a href="#$version">$VERSION</a> and
<a href="#$lib-version">$LIB-VERSION</a>
</h5>
<p>
<hr><h4><a name="$iflibver">$IFLIBVER this <float> <truebranch> $endif
<br>
$IFLIBVER this <float> <truebranch> $else <falsebranch> $endif
<br>
$IFLIBVER $<libname> <float> <truebranch> $endif
<br>
$IFLIBVER $<libname> <float> <truebranch> $else <falsebranch> $endif
<br>
$IFLIBVER <dbref> <float> <truebranch> $endif
<br>
$IFLIBVER <dbref> <float> <truebranch> $else <falsebranch> $endif
<br>
<br>
</a></h4>
This determines whether or not to compile optional sections of code,
depending on the $lib-version of the given program, which is stored in its
'_lib-version' property. In the form '$iflibver this' then this checks this
compiling program's $lib-version. Otherwise, this checks the $lib-version
of the program referenced by $regname or #dbref.
<p>
The <truebranch> will be compiled if the given program's $lib-version
is greater than or equal to the given <float>, using a floating point
number comparison. Otherwise, the <falsebranch>, if given, will be
compiled.
<p><h5>Also see:
<a href="#$ifnlibver">$IFNLIBVER</a>,
<a href="#$ifnver">$IFNVER</a>,
<a href="#$ifdef">$IFDEF</a>,
<a href="#$version">$VERSION</a> and
<a href="#$lib-version">$LIB-VERSION</a>
</h5>
<p>
<hr><h4><a name="$ifnlibver">$IFNLIBVER this <float> <truebranch> $endif
<br>
$IFNLIBVER this <float> <truebranch> $else <falsebranch> $endif
<br>
$IFNLIBVER $<libname> <float> <truebranch> $endif
<br>
$IFNLIBVER $<libname> <float> <truebranch> $else <falsebranch> $endif
<br>
$IFNLIBVER <dbref> <float> <truebranch> $endif
<br>
$IFNLIBVER <dbref> <float> <truebranch> $else <falsebranch> $endif
<br>
<br>
</a></h4>
This determines whether or not to compile optional sections of code,
depending on the $lib-version of the given program, which is stored in its
'_lib-version' property. In the form '$ifnlibver this' then this checks this
compiling program's $lib-version. Otherwise, this checks the $lib-version
of the program referenced by $regname or #dbref.
<p>
The <truebranch> will be compiled if the given program's $lib-version
is less than the given <float>, using a floating point number comparison.
Otherwise, the <falsebranch>, if given, will be compiled.
<p><h5>Also see:
<a href="#$iflibver">$IFLIBVER</a>,
<a href="#$ifver">$IFVER</a>,
<a href="#$ifdef">$IFDEF</a>,
<a href="#$version">$VERSION</a> and
<a href="#$lib-version">$LIB-VERSION</a>
</h5>
<p>
<hr><h4><a name="$iflib">$IFLIB $<libname> <truebranch> $endif
<br>
$IFLIB $<libname> <truebranch> $else <falsebranch> $endif
<br>
$IFLIB <dbref> <truebranch> $endif
<br>
$IFLIB <dbref> <truebranch> $else <falsebranch> $endif
<br>
<br>
</a></h4>
This determines whether or not to compile optional sections of code,
depending on the existence of a given program.
<p>
The <truebranch> will be compiled if the given object exists and is a
program. Otherwise, the <falsebranch>, if given, will be compiled.
<p><h5>Also see:
<a href="#$ifnlib">$IFNLIB</a>,
<a href="#$iflibver">$IFLIBVER</a>,
<a href="#$ifver">$IFVER</a>,
<a href="#$ifdef">$IFDEF</a>,
<a href="#$version">$VERSION</a> and
<a href="#$lib-version">$LIB-VERSION</a>
</h5>
<p>
<hr><h4><a name="$ifnlib">$IFNLIB $<libname> <truebranch> $endif
<br>
$IFNLIB $<libname> <truebranch> $else <falsebranch> $endif
<br>
$IFNLIB <dbref> <truebranch> $endif
<br>
$IFNLIB <dbref> <truebranch> $else <falsebranch> $endif
<br>
<br>
</a></h4>
This determines whether or not to compile optional sections of code,
depending on the existence of a given program.
<p>
The <truebranch> will be compiled if the given object does not exist, or
if it is not a program. Otherwise, the <falsebranch>, if given, will be
compiled.
<p><h5>Also see:
<a href="#$iflib">$IFLIB</a>,
<a href="#$iflibver">$IFLIBVER</a>,
<a href="#$ifver">$IFVER</a>,
<a href="#$ifdef">$IFDEF</a>,
<a href="#$version">$VERSION</a> and
<a href="#$lib-version">$LIB-VERSION</a>
</h5>
<p>
<hr><h4><a name="$ifcancall">$IFCANCALL this <publicname> <truebranch> $endif
<br>
$IFCANCALL this <publicname> <truebranch> $else <falsebranch> $endif
<br>
$IFCANCALL $<libname> <publicname> <truebranch> $endif
<br>
$IFCANCALL $<libname> <publicname> <truebranch> $else <falsebranch> $endif
<br>
$IFCANCALL <dbref> <publicname> <truebranch> $endif
<br>
$IFCANCALL <dbref> <publicname> <truebranch> $else <falsebranch> $endif
<br>
<br>
</a></h4>
This determines whether or not to compile optional sections of code,
depending on the ability for the compiling program to call a given public
function on a given program.
<p>
If the given program is given as 'this', then this will check if the
given callable function was declared earlier in this compiling program.
<p>
The <truebranch> will be compiled if the given program exists, is a
program, and has a given callable function (declared with PUBLIC or WIZCALL)
that this compiling program has permission to call. Otherwise, the
<falsebranch>, if given, will be compiled.
<p><h5>Also see:
<a href="#$ifncancall">$IFNCANCALL</a>,
<a href="#$iflib">$IFLIB</a>,
<a href="#$iflibver">$IFLIBVER</a>,
<a href="#$ifver">$IFVER</a>,
<a href="#$ifdef">$IFDEF</a>,
<a href="#$version">$VERSION</a> and
<a href="#$lib-version">$LIB-VERSION</a>
</h5>
<p>
<hr><h4><a name="$ifncancall">$IFNCANCALL this <publicname> <truebranch> $endif
<br>
$IFNCANCALL this <publicname> <truebranch> $else <falsebranch> $endif
<br>
$IFNCANCALL $<libname> <publicname> <truebranch> $endif
<br>
$IFNCANCALL $<libname> <publicname> <truebranch> $else <falsebranch> $endif
<br>
$IFNCANCALL <dbref> <publicname> <truebranch> $endif
<br>
$IFNCANCALL <dbref> <publicname> <truebranch> $else <falsebranch> $endif
<br>
<br>
</a></h4>
This determines whether or not to compile optional sections of code,
depending on the ability for the compiling program to call a given public
function on a given program.
<p>
If the given program is given as 'this', then this will check if the
given callable function was declared earlier in this compiling program.
<p>
The <truebranch> will be compiled if the given program does not exist,
is not a program, or does not have a given callable function (declared with
PUBLIC or WIZCALL) that this compiling program has permission to call.
Otherwise, the <falsebranch>, if given, will be compiled.
<p><h5>Also see:
<a href="#$ifcancall">$IFCANCALL</a>,
<a href="#$iflib">$IFLIB</a>,
<a href="#$iflibver">$IFLIBVER</a>,
<a href="#$ifver">$IFVER</a>,
<a href="#$ifdef">$IFDEF</a>,
<a href="#$version">$VERSION</a> and
<a href="#$lib-version">$LIB-VERSION</a>
</h5>
<p>
<hr><h4><a name="$echo">$ECHO <string>
<br>
</a></h4>
Echos the given string to the screen of the person compiling the program.
Runs at compile-time.
<p>
<hr><h4><a name="$abort">$ABORT <message>
<br>
</a></h4>
Aborts compiling and prints out the error message.
<p>
<hr><h4><a name="$pragma">$PRAGMA <pragmatype> [<args>]
<br>
</a></h4>
Sets a compiler option in a backwards compatible manner. If the pragmatype
isn't recognized, the compiler will just ignore this line and continue its
compile attempt. The $pragma directive must be all on one line, and the
entire rest of the line after the pragmatype is assumed to be arguments for
that pragmatype. The currently supported pragmatypes are:
COMMENT_STRICT
<p>
This specifies that comments are in the old style that is terminated by the
first end-paren ')' in the comment.
COMMENT_RECURSE
<p>
This specifies that comments are in the new recursive style where any parens
'(' in a comment must be matched by end-parens ')'.
COMMENT_LOOSE
<p>
This is the default comment style, where the compiler tries to compile
comments as if in comment_recurse mode, but will fall back to comment_strict
mode if a comment fails to have balancing parens.
<p>
<hr><h4><a name="\">Escaping Literal Tokens:
<br>
<br>
</a></h4>
You can escape a token in MUF so that it will be interpreted literally.
ie: \.pmatch will try to compile '.pmatch' without expanding it as a
macro. This lets you make special things with $defines such as:
<pre>
$define addprop over over or if \addprop else pop pop remove_prop $enddef
</pre>
so that all the 'addprop's in the program will be expanded to the
definition, but the 'addprop' in the definition will not try to expand
recursively. It will call the actual addprop.
<p>
<p><hr size=6>
<h3><a name="StackOps">Stack Manipulation Operators</a></h3>
<blockquote><table border=0>
<tr>
<td width="14%"> <a href="#depth">depth</a> </td>
<td width="14%"> <a href="#dup">dup</a> </td>
<td width="14%"> <a href="#dupn">dupn</a> </td>
<td width="14%"> <a href="#ldup">ldup</a> </td>
<td width="14%"> <a href="#lreverse">lreverse</a> </td>
<td width="14%"> <a href="#over">over</a> </td>
<td width="14%"> <a href="#pick">pick</a> </td>
</tr>
<tr>
<td width="14%"> <a href="#pop">pop</a> </td>
<td width="14%"> <a href="#popn">popn</a> </td>
<td width="14%"> <a href="#put">put</a> </td>
<td width="14%"> <a href="#reverse">reverse</a> </td>
<td width="14%"> <a href="#rot">rot</a> </td>
<td width="14%"> <a href="#rotate">rotate</a> </td>
<td width="14%"> <a href="#swap">swap</a> </td>
</tr>
<tr>
<td width="14%"> <a href="#{">{</a> </td>
<td width="14%"> <a href="#}">}</a> </td>
</tr>
</table></blockquote>
<hr><h4><a name="pop">POP ( x -- )
<br>
<br>
</a></h4>
Pops the top of the stack into oblivion.
<p><h5>Also see:
<a href="#popn">POPN</a>
</h5>
<p>
<hr><h4><a name="popn">POPN ( ?n..?1 i -- )
<br>
<br>
</a></h4>
Pops the top i stack items.
<p><h5>Also see:
<a href="#pop">POP</a>
</h5>
<p>
<hr><h4><a name="dup">DUP ( x -- x x )
<br>
<br>
</a></h4>
Duplicates the item at the top of the stack.
<p><h5>Also see:
<a href="#dupn">DUPN</a> and
<a href="#ldup">LDUP</a>
</h5>
<p>
<hr><h4><a name="dupn">DUPN ( ?n..?1 i -- ?n..?1 ?n..?1 )
<br>
<br>
</a></h4>
Duplicates the top i stack items.
<p><h5>Also see:
<a href="#dup">DUP</a> and
<a href="#ldup">LDUP</a>
</h5>
<p>
<hr><h4><a name="ldup">LDUP ( {?} -- {?} {?} )
<br>
<br>
</a></h4>
Duplicates a stackrange on top of the stack.
<p><h5>Also see:
<a href="#dup">DUP</a> and
<a href="#dupn">DUPN</a>
</h5>
<p>
<hr><h4><a name="swap">SWAP ( x y -- y x )
<br>
<br>
</a></h4>
Takes objects x and y on the stack and reverses their order.
<p><h5>Also see:
<a href="#pick">PICK</a>,
<a href="#over">OVER</a> and
<a href="#dup">DUP</a>
</h5>
<p>
<hr><h4><a name="over">OVER ( x y -- x y x )
<br>
<br>
</a></h4>
Duplicates the second-to-top thing on the stack. This is the same as 2 pick.
<p><h5>Also see:
<a href="#pick">PICK</a>,
<a href="#swap">SWAP</a> and
<a href="#dup">DUP</a>
</h5>
<p>
<hr><h4><a name="rot">ROT ( x y z -- y z x )
<br>
<br>
</a></h4>
Rotates the top three things on the stack. This is equivalent to 3 rotate.
<p><h5>Also see:
<a href="#rotate">ROTATE</a> and
<a href="#swap">SWAP</a>
</h5>
<p>
<hr><h4><a name="rotate">ROTATE ( ni ... n1 i -- n(i-1) ... n1 ni )
<br>
<br>
</a></h4>
Rotates the top i things on the stack. Using a negative rotational
value rotates backwards.
Examples:
<pre>
"a" "b" "c" "d" 4 rotate
</pre>
would leave
<pre>
"b" "c" "d" "a"
</pre>
on the stack.
<pre>
"a" "b" "c" "d" -4 rotate
</pre>
would leave
</pre>
<p>
"d" "a" "b" "c"
</pre>
on the stack.
<p><h5>Also see:
<a href="#rot">ROT</a> and
<a href="#swap">SWAP</a>
</h5>
<p>
<hr><h4><a name="pick">PICK ( ni ... n1 i -- ni ... n1 ni )
<br>
<br>
</a></h4>
Takes the i'th thing from the top of the stack and pushes it on the top.
1 pick is equivalent to dup, and 2 pick is equivalent to over.
<p><h5>Also see:
<a href="#over">OVER</a> and
<a href="#put">PUT</a>
</h5>
<p>
<hr><h4><a name="put">PUT ( nx...n1 ni i -- nx...ni...n1 )
<br>
<br>
</a></h4>
Replaces the i'th item from the top of the stack with the value of ni.
The command sequence '1 put' is equivalent to 'swap pop'.
Example:
<pre>
"a" "b" "c" "d" "e" 3 put
</pre>
would return on the stack:
<pre>
"a" "e" "c" "d"
</pre>
<p><h5>Also see:
<a href="#pick">PICK</a>
</h5>
<p>
<hr><h4><a name="reverse">REVERSE ( ?n..?1 i -- ?1..?n )
<br>
<br>
</a></h4>
Reverses the order of the top i items on the stack.
Example:
<pre>
"a" "b" "c" "d" "e" 4 reverse
</pre>
would return on the stack:
<pre>
"a" "e" "d" "c" "b"
</pre>
<p><h5>Also see:
<a href="#lreverse">LREVERSE</a>
</h5>
<p>
<hr><h4><a name="lreverse">LREVERSE ( ?n..?1 i -- ?1..?n i )
<br>
<br>
</a></h4>
Reverses the order of the top i stack items, leaving i.
Example:
<pre>
"a" "b" "c" "d" "e" 4 lreverse
</pre>
would return on the stack:
<pre>
"a" "e" "d" "c" "b" 4
</pre>
<p><h5>Also see:
<a href="#reverse">REVERSE</a>
</h5>
<p>
<hr><h4><a name="depth">DEPTH ( -- i )
<br>
<br>
</a></h4>
Returns the number of items currently on the stack.
<p>
<hr><h4><a name="{">{ ( -- marker)
<br>
<br>
</a></h4>
Pushes a marker onto the stack, to be used with } or }list or }dict.
<p><h5>Also see:
<a href="#}">}</a>,
<a href="#}list">}list</a>,
<a href="#}dict">}dict</a>,
<a href="#}tell">}tell</a> and
<a href="#}join">}join</a>
</h5>
<p>
<hr><h4><a name="}">} ( marker ?n ... ?1 -- ?n ... ?1 i )
<br>
<br>
</a></h4>
Finds the topmost marker in the stack, and counts how many stack items
are between it and the top of the stack. The marker is removed from the
stack, and the count is pushed onto the stack.
<p><h5>Also see:
<a href="#{">{</a>,
<a href="#}list">}list</a>,
<a href="#}dict">}dict</a>,
<a href="#}tell">}tell</a> and
<a href="#}join">}join</a>
</h5>
<p>
<p><hr size=6>
<h3><a name="VarHandling">Variables and Handling Thereof</a></h3>
<blockquote><table border=0>
<tr>
<td width="14%"> <a href="#!">!</a> </td>
<td width="14%"> <a href="#@">@</a> </td>
<td width="14%"> <a href="#command">command</a> </td>
<td width="14%"> <a href="#loc">loc</a> </td>
<td width="14%"> <a href="#localvar">localvar</a> </td>
<td width="14%"> <a href="#lvar">lvar</a> </td>
<td width="14%"> <a href="#me">me</a> </td>
</tr>
<tr>
<td width="14%"> <a href="#trigger">trigger</a> </td>
<td width="14%"> <a href="#var">var</a> </td>
<td width="14%"> <a href="#var!">var!</a> </td>
<td width="14%"> <a href="#variable">variable</a> </td>
</tr>
</table></blockquote>
<hr><h4><a name="me">ME @
<br>
<br>
</a></h4>
There is a global variable named ME that contains the dbref of the
player who invoked the program. The value of this variable is not
guaranteed to be secure, as another program could change the value of
ME then call your program. If you must be certain that the value of
the ME variable is correct, use the commands:
<pre>
"me" match me !
</pre>
The ME global variable is the same variable as '0 variable'
<p><h5>Also see:
<a href="#command">COMMAND</a>,
<a href="#trigger">TRIGGER</a> and
<a href="#loc">LOC</a>
</h5>
<p>
<hr><h4><a name="loc">LOC @
<br>
<br>
</a></h4>
There is a global variable named LOC that contains the dbref of the
location of the player who invoked the program. The value of this
variable is not guaranteed to be secure, as another program could change
the value of LOC then call your program. If you must be certain that
the value of the LOC variable is correct, use the commands:
<pre>
"me" match location loc !
</pre>
The LOC global variable is the same variable as '1 variable'
<p><h5>Also see:
<a href="#command">COMMAND</a>,
<a href="#trigger">TRIGGER</a> and
<a href="#me">ME</a>
</h5>
<p>
<hr><h4><a name="trigger">TRIGGER @
<br>
<br>
</a></h4>
There is a global variable named TRIGGER that contains the dbref of the
trigger object that invoked the process. The value of this variable is
not guaranteed to be secure, as another program could change the value of
TRIGGER then call your program. If you must be certain that the value of
the TRIGGER variable is correct, use the commands:
<pre>
trig trigger !
</pre>
The TRIGGER global variable is the same variable as '2 variable'
The value of TRIGGER will be #-1 for AUTOSTART programs,
<p><h5>Also see:
<a href="#command">COMMAND</a>,
<a href="#loc">LOC</a> and
<a href="#me">ME</a>
</h5>
<p>
<hr><h4><a name="command">COMMAND @
<br>
<br>
</a></h4>
There is a COMMAND variable, similar to ME, LOC, and TRIGGER, except that
it contains a string. The string contains the command the user typed
that triggered the the program, without the command line arguments. ie:
if there was an exit named "abracadabra;foo bar;frozzboz" that was linked
to the program, and the user typed in "foo bar baz", then the program
would run with "baz" on the stack, and "foo bar" in the global COMMAND
variable. The TRIGGER global variable is the same variable as '2 variable'
<p><h5>Also see:
<a href="#trigger">TRIGGER</a>,
<a href="#loc">LOC</a> and
<a href="#me">ME</a>
</h5>
<p>
<hr><h4><a name="var">VAR <name>
<br>
<br>
</a></h4>
When used inside a function, a function-scoped variable is created.
This variable is local to each invocation of a given function; recursive
calls each get their own scoped variable dataspace. This variable type
is analogous to C's function-scoped variables. The use of function-scoped
variables is highly recomended to make functions more readable.
<p>
When used outside of a function, the compiler allows the use of <name>
as a global variable in all functions defined after the var declaration.
This variable dataspace is shared between ALL muf programs called in
this process. This means that if program A declares a global variable,
then calls program B, and program B also declares a global variable,
then changes its value, then the global variable declared in program A
will also have been changed. For this reason, this usage of VAR is
deprecated and shoud NOT be used. Use LVAR instead. This usage is only
kept around for backwards compatability with some old icky programs that
used this feature to pass data between some programs.
<p><h5>Also see:
<a href="#var!">VAR!</a>,
<a href="#lvar">LVAR</a>,
<a href="#!">!</a>,
<a href="#@">@</a>,
<a href="#variable">VARIABLE</a> and
<a href="#localvar">LOCALVAR</a>
</h5>
<p>
<hr><h4><a name="var!">VAR! <name>
<br>
<br>
</a></h4>
This must be used within a function. It declares a function-scoped
variable named <name> that then has its value set to the topmost stack
item. For example, the following program prints out "Hello World!":
<pre>
: myfunction
"Hello World!" var! foo
me @ foo @ notify
;
</pre>
<p><h5>Also see:
<a href="#var">VAR</a>,
<a href="#lvar">LVAR</a>,
<a href="#!">!</a>,
<a href="#@">@</a>,
<a href="#variable">VARIABLE</a> and
<a href="#localvar">LOCALVAR</a>
</h5>
<p>
<hr><h4><a name="lvar">LVAR <varname>
<br>
<br>
</a></h4>
This declares a variable as a program-local variable. If another program
calls this program, the values of the program-local variables will not be
changed in the calling program, even if the called program changes them.
This variable will be available to all functions defined later in the
program, after the lvar declaration. This variable's data is persistent
within this process. Ie: if program A calls program B, and program B sets
the value of this program-local variable, then returns to A, which then
calls B again, the value of this variable will still have the value it was
set to in the first call. The value is NOT persistent between different
processes. This variable type is analogous to C's global variables.
<p><h5>Also see:
<a href="#var">VAR</a>,
<a href="#var!">VAR!</a>,
<a href="#!">!</a>,
<a href="#@">@</a>,
<a href="#variable">VARIABLE</a> and
<a href="#localvar">LOCALVAR</a>
</h5>
<p>
<hr><h4><a name="@">@ ( v -- x )
<br>
<br>
</a></h4>
Retrieves variable v's value x.
<p><h5>Also see:
<a href="#!">!</a>,
<a href="#variable">VARIABLE</a>,
<a href="#var">VAR</a>,
<a href="#lvar">LVAR</a>,
<a href="#localvar">LOCALVAR</a> and
<a href="#miscellaneous">MISCELLANEOUS</a>
</h5>
<p>
<hr><h4><a name="!">! ( x v -- )
<br>
<br>
</a></h4>
Sets variable v's value to x.
<p><h5>Also see:
<a href="#@">@</a>,
<a href="#variable">VARIABLE</a>,
<a href="#var">VAR</a>,
<a href="#lvar">LVAR</a>,
<a href="#localvar">LOCALVAR</a> and
<a href="#miscellaneous">MISCELLANEOUS</a>
</h5>
<p>
<hr><h4><a name="variable">VARIABLE ( i -- v )
<br>
<br>
</a></h4>
Converts integer i to global variable reference v. Of the pre-defined
variables, `me' corresponds to integer 0, `loc' to 1, `trigger' to 2,
and 'command' to 3.
Thus:
<pre>
me @
</pre>
and
<pre>
0 variable @
</pre>
will do the same thing (returning the user's dbref). User-defined variables
are numbered sequentially starting at 4 by the compiler. Note that these
variable numbers can be used even if variables have not been formally
declared. This command has been deprecated, and is not recommended to use.
It's original purpose was to allow MUF to do small arrays. Since MUF now
has an intrinsic array stack item type, this should no longer be used.
<p><h5>Also see:
<a href="#@">@</a>,
<a href="#!">!</a>,
<a href="#var">VAR</a>,
<a href="#me">ME</a>,
<a href="#trigger">TRIGGER</a>,
<a href="#loc">LOC</a> and
<a href="#command">COMMAND</a>
</h5>
<p>
<hr><h4><a name="localvar">LOCALVAR (i -- l)
<br>
<br>
</a></h4>
Takes an integer and returns the respective program-local variable.
Similar to the 'variable' primitive. Use of this command is deprecated
and is not recommended. Use the array stack item type instead.
<p><h5>Also see:
<a href="#variable">VARIABLE</a>,
<a href="#var">VAR</a>,
<a href="#lvar">LVAR</a>,
<a href="#@">@</a> and
<a href="#!">!</a>
</h5>
<p>
<p><hr size=6>
<h3><a name="LogicOps">Logical Operators</a></h3>
<blockquote><table border=0>
<tr>
<td width="16%"> <a href="#<"><</a> </td>
<td width="16%"> <a href="#<= "><= </a> </td>
<td width="16%"> <a href="#=">=</a> </td>
<td width="16%"> <a href="#>">></a> </td>
<td width="16%"> <a href="#>=">>=</a> </td>
<td width="16%"> <a href="#address?">address?</a> </td>
</tr>
<tr>
<td width="16%"> <a href="#and">and</a> </td>
<td width="16%"> <a href="#array?">array?</a> </td>
<td width="16%"> <a href="#dbref?">dbref?</a> </td>
<td width="16%"> <a href="#dictionary?">dictionary?</a> </td>
<td width="16%"> <a href="#float?">float?</a> </td>
<td width="16%"> <a href="#int?">int?</a> </td>
</tr>
<tr>
<td width="16%"> <a href="#lock?">lock?</a> </td>
<td width="16%"> <a href="#not">not</a> </td>
<td width="16%"> <a href="#or">or</a> </td>
<td width="16%"> <a href="#string?">string?</a> </td>
<td width="16%"> <a href="#xor">xor</a> </td>
</tr>
</table></blockquote>
<hr><h4><a name="<">< ( n1 n2 -- i )
<br>
<br>
</a></h4>
Compares two numbers and returns 1 if n1 is less than n2, and 0 otherwise.
<p><h5>Also see:
<a href="#>">></a>,
<a href="#<="><=</a>,
<a href="#>=">>=</a>,
<a href="#=">=</a>,
<a href="#not">NOT</a>,
<a href="#and">AND</a> and
<a href="#or">OR</a>
</h5>
<p>
<hr><h4><a name=">">> ( n1 n2 -- i )
<br>
<br>
</a></h4>
Compares two numbers and returns 1 if n1 is greater than n2, and 0 otherwise.
<p><h5>Also see:
<a href="#<"><</a>,
<a href="#<="><=</a>,
<a href="#>=">>=</a>,
<a href="#=">=</a>,
<a href="#not">NOT</a>,
<a href="#and">AND</a> and
<a href="#or">OR</a>
</h5>
<p>
<hr><h4><a name="=">= ( n1 n2 -- i )
<br>
<br>
</a></h4>
Compares two numbers and returns 1 if n1 is equal to n2, and 0 otherwise.
<p><h5>Also see:
<a href="#<"><</a>,
<a href="#>">></a>,
<a href="#<="><=</a>,
<a href="#>=">>=</a>,
<a href="#not">NOT</a>,
<a href="#and">AND</a> and
<a href="#or">OR</a>
</h5>
<p>
<hr><h4><a name="<= "><= ( n1 n2 -- i )
<br>
<br>
</a></h4>
Compares two numbers and returns 1 if n1 is less than or equal to n2,
and 0 otherwise.
<p><h5>Also see:
<a href="#<"><</a>,
<a href="#>">></a>,
<a href="#=">=</a>,
<a href="#>=">>=</a>,
<a href="#not">NOT</a>,
<a href="#and">AND</a> and
<a href="#or">OR</a>
</h5>
<p>
<hr><h4><a name=">=">>= ( n1 n2 -- i )
<br>
<br>
</a></h4>
Compares two numbers and returns 1 if n1 is greater than or equal to n2,
and 0 otherwise.
<p><h5>Also see:
<a href="#<"><</a>,
<a href="#>">></a>,
<a href="#<="><=</a>,
<a href="#=">=</a>,
<a href="#not">NOT</a>,
<a href="#and">AND</a> and
<a href="#or">OR</a>
</h5>
<p>
<hr><h4><a name="not">NOT ( x -- i )
<br>
<br>
</a></h4>
Returns true (1) if the top stack item is considered false. Returns
false (0) otherwise. The stack item can be of any type. For the various
types, here are their false values:
<pre>
Integer 0
Float 0.0
DBRef #-1
String ""
</pre>
<p><h5>Also see:
<a href="#and">AND</a>,
<a href="#or">OR</a> and
<a href="#xor">XOR</a>
</h5>
<p>
<hr><h4><a name="and">AND ( x1 x2 -- i )
<br>
<br>
</a></h4>
Returns true (1) if both of the top two stack items are considered true.
Returns false (0) otherwise. The stack items can be of any type. For the
various types, here are their false values:
<pre>
Integer 0
Float 0.0
DBRef #-1
String ""
</pre>
<p><h5>Also see:
<a href="#not">NOT</a>,
<a href="#or">OR</a> and
<a href="#xor">XOR</a>
</h5>
<p>
<hr><h4><a name="or">OR ( x1 x2 -- i )
<br>
<br>
</a></h4>
Returns true (1) if either of the top two stack items are considered true.
Returns false (0) otherwise. The stack items can be of any type. For the
various types, here are their false values:
<pre>
Integer 0
Float 0.0
DBRef #-1
String ""
</pre>
<p><h5>Also see:
<a href="#not">NOT</a>,
<a href="#and">AND</a> and
<a href="#xor">XOR</a>
</h5>
<p>
<hr><h4><a name="xor">XOR ( x1 x2 -- i )
<br>
<br>
</a></h4>
Returns true (1) if either of the top two stack items are considered true,
but NOT both of them. Returns false (0) otherwise. The stack items can be
of any type. For the various types, here are their false values:
<pre>
Integer 0
Float 0.0
DBRef #-1
String ""
</pre>
<p><h5>Also see:
<a href="#not">NOT</a>,
<a href="#and">AND</a> and
<a href="#or">OR</a>
</h5>
<p>
<hr><h4><a name="string?">STRING? ( x -- i )
<br>
<br>
</a></h4>
Returns true if x is a string.
<p>
<hr><h4><a name="int?">INT? ( x -- i )
<br>
<br>
</a></h4>
Returns true if x is a int.
<p>
<hr><h4><a name="float?">FLOAT? ( ? -- i )
<br>
<br>
</a></h4>
Returns true if the item on the stack is a floating point value.
<p>
<hr><h4><a name="dbref?">DBREF? ( x -- i )
<br>
<br>
</a></h4>
Returns true if x is a dbref.
<p>
<hr><h4><a name="array?">ARRAY? ( ? -- i )
<br>
<br>
</a></h4>
Tests if stack item is an array. Returns i as 1 if so, 0 if
otherwise.
<p><h5>Also see:
<a href="#dictionary?">DICTIONARY?</a>,
<a href="#int?">INT?</a>,
<a href="#dbref?">DBREF?</a>,
<a href="#array_make_dict">ARRAY_MAKE_DICT</a> and
<a href="#array_make">ARRAY_MAKE</a>
</h5>
<p>
<hr><h4><a name="dictionary?">DICTIONARY? ( ? -- i )
<br>
<br>
</a></h4>
Tests if stack item is an array of dictionary type. Returns i as 1
if so, 0 if otherwise.
<p><h5>Also see:
<a href="#array?">ARRAY?</a>,
<a href="#int?">INT?</a>,
<a href="#dbref?">DBREF?</a>,
<a href="#array_make_dict">ARRAY_MAKE_DICT</a> and
<a href="#array_make">ARRAY_MAKE</a>
</h5>
<p>
<hr><h4><a name="address?">ADDRESS? (? -- i)
<br>
<br>
</a></h4>
Returns true if the top stack item is a function address.
<p>
<hr><h4><a name="lock?">LOCK? (? -- i)
<br>
<br>
</a></h4>
Returns true if the top stack item is a lock.
<p><h5>Also see:
<a href="#getprop">GETPROP</a>,
<a href="#setprop">SETPROP</a>,
<a href="#parselock">PARSELOCK</a>,
<a href="#unparselock">UNPARSELOCK</a>,
<a href="#prettylock">PRETTYLOCK</a> and
<a href="#testlock">TESTLOCK</a>
</h5>
<p>
<p><hr size=6>
<h3><a name="ExecStructs">Execution Control Structures</a></h3>
<blockquote><table border=0>
<tr>
<td width="20%"> <a href="#'">'</a> </td>
<td width="20%"> <a href="#begin">begin</a> </td>
<td width="20%"> <a href="#break">break</a> </td>
<td width="20%"> <a href="#call">call</a> </td>
<td width="20%"> <a href="#cancall?">cancall?</a> </td>
</tr>
<tr>
<td width="20%"> <a href="#continue">continue</a> </td>
<td width="20%"> <a href="#else">else</a> </td>
<td width="20%"> <a href="#execute">execute</a> </td>
<td width="20%"> <a href="#exit">exit</a> </td>
<td width="20%"> <a href="#for">for</a> </td>
</tr>
<tr>
<td width="20%"> <a href="#foreach">foreach</a> </td>
<td width="20%"> <a href="#if">if</a> </td>
<td width="20%"> <a href="#interp">interp</a> </td>
<td width="20%"> <a href="#jmp">jmp</a> </td>
<td width="20%"> <a href="#loop-example1">loop-example1</a> </td>
</tr>
<tr>
<td width="20%"> <a href="#loop-example2">loop-example2</a> </td>
<td width="20%"> <a href="#loop-example3">loop-example3</a> </td>
<td width="20%"> <a href="#loops">loops</a> </td>
<td width="20%"> <a href="#public">public</a> </td>
<td width="20%"> <a href="#repeat">repeat</a> </td>
</tr>
<tr>
<td width="20%"> <a href="#then">then</a> </td>
<td width="20%"> <a href="#until">until</a> </td>
<td width="20%"> <a href="#while">while</a> </td>
<td width="20%"> <a href="#wizcall">wizcall</a> </td>
</tr>
</table></blockquote>
<hr><h4><a name="if">IF (x -- ) ... THEN
<br>
IF (x -- ) ... ELSE ... THEN
<br>
<br>
</a></h4>
Examines boolean value x. If x is TRUE, the sequence of statements
after the 'if' up until the `then' (or until the `else' if it is
present) performed. If it is FALSE, then these statements are skipped,
and if an `else' is present, the statements between the `else' and the
`then' are performed. Control continues as usual at the statement
after the `then'. Note that checking the top of the stack actually
pops it, so if you want to re-use it, you should dup (see DUP) it
before the if. For every IF in a word, there MUST be a THEN, and
vice-versa. ELSE is optional.
<p>
<hr><h4><a name="else">IF (x -- ) ... ELSE ... THEN
<br>
<br>
</a></h4>
Begins an ELSE block in an IF-ELSE-THEN code block. If the value
tested by the IF is false, then this code block will be executed.
<p><h5>Also see:
<a href="#if">IF</a> and
<a href="#then">THEN</a>
</h5>
<p>
<hr><h4><a name="then">IF (x -- ) ... THEN
<br>
IF (x -- ) ... ELSE ... THEN
<br>
<br>
</a></h4>
Denotes the end of an IF-THEN or IF-ELSE-THEN code block.
<p><h5>Also see:
<a href="#if">IF</a> and
<a href="#else">ELSE</a>
</h5>
<p>
<hr><h4><a name="'">'FUNCNAME ( -- a )
<br>
<br>
</a></h4>
Pushed the address of the start of the previously defined function
FUNCNAME onto the stack. This can be useful for use with EXECUTE and
arrays to make a list of functions you can call by index, or for making
function callbacks.
<p>
<hr><h4><a name="execute">EXECUTE ( a -- ?? )
<br>
<br>
</a></h4>
Executes the function pointed to by the address a on the stack.
This function does NOT need to be in the same program as the function
that did the EXECUTE.
<p><h5>Also see:
<a href="#'">'</a>
</h5>
<p>
<hr><h4><a name="jmp">JMP (a -- )
<br>
<br>
</a></h4>
The JMP primitive takes an address like those supplied by 'funcname and
moves execution to that point. It's one early way that was used to do
tail-recursion loops without as much overhead, and without failing due to
system stack overflows. It's mostly obsolete now, except that it's one
of the three or four internal primitives used to implement IF-ELSE-THEN and
BEGIN-WHILE-REPEAT loops and such. You shouldn't use JMP explicitly in
in modern MUF code, as it is deprecated. NOTE: Using JMP to jump into a
different function can have problems, and is not recommended.
Example of JMP as a tail-recursion optimization:
<pre>
: countforever ( i -- )
1 +
dup intostr .tell
'countforever jmp
;
</pre>
A better ways to do the same thing with looping primitives would be:
<pre>
: countforever ( i -- )
begin
1 +
dup intostr .tell
repeat
;
</pre>
<p><h5>Also see:
<a href="#'">'</a> and
<a href="#execute">EXECUTE</a>
</h5>
<p>
<hr><h4><a name="call">CALL ( d -- ?? )
<br>
CALL ( d s -- ?? )
<br>
<br>
</a></h4>
Calls another program d. Program d will inherit the values of ME, LOC,
TRIGGER, and all other global variables. If used in the second form,
this will call the named PUBLIC function s in the given program d.
The called program will NOT share the same localvars as the caller,
unless the caller is calling itself.
<p>
<hr><h4><a name="interp">INTERP ( d1 d2 s -- ? )
<br>
<br>
</a></h4>
Takes a program dbref to run d1, the trigger to use d2, and the top stack
item string and calls the program with the given string on the stack.
Returns when intShowing the first 100 KB of 314.7 KB. Download the archive for the full file.