WoW:Console: Difference between revisions

No edit summary
No edit summary
Line 5: Line 5:
A command is a function associated with a string that contains no whitespace. The function accepts the name of the command as a string, as well as an optional argument string. For example, running the following command:
A command is a function associated with a string that contains no whitespace. The function accepts the name of the command as a string, as well as an optional argument string. For example, running the following command:


<code>
<pre>
RUN commandname "with argument"
RUN commandname "with argument"
</code>
</pre>


will dispatch a handler function:
will dispatch a handler function:


<code>
<pre>
int32 handler(const char* command, const char* argument) {
int32 handler(const char* command, const char* argument) {
   print(command);  // "commandname"
   print(command);  // "commandname"
Line 17: Line 17:
   return 1;
   return 1;
}
}
</code>
</pre>


=== Categories ===
=== Categories ===


Every [[#Commands|Command]] or [[WoW:CVar]] belongs to a category number.
Every [[#Commands|Command]] or [[WoW:CVar]] belongs to a category number.