Editing version 4 of page APIs_RegCommand (this is the most recent revision)
Note: This page is defined as a special page, and as such its final state may be different from what you see here.
Use template:
None
API_Template
DevTrack_Template
Version_Template
==Subroutine Name
**RegCommand**
==Explanation and Usage
This will register a command, which will be called via the 'do' parameter (`do=action`).
==Syntax
**`RegCommand(Name, Subroutine, Display)`**
==Options
**Name** - This is the name to associate with the action.
**Subroutine** - This should be the subroutine that is called when the action you specify is called via the 'do' parameter. Must be entered in this format: \&SubroutineName
**Display** - Beginning with Aneuch 0.40, the display variable was added. This is what will show up in the visitor log for the command you are defining. There are a couple of things you can put in here:
* `%s`: This will get replaced by the name of the page
* `%d`: This will get replaced by the page revision
==Examples
These are actual examples from the Aneuch source code:
**`RegCommand('admin', \&DoAdmin, 'was in Administrative mode, doing %s');`**\\This will register the command 'admin', and specify that the subroutine DoAdmin should be called. This would take place by the user calling "?do=admin". It will show up in the visitor log as "was in Administrative mode, doing <admin page name>".
**`RegCommand('revision', \&DoRevision, 'was viewing revision %d of page %s');`**\\This will register the command 'revision', and specify that the subroutine DoRevision should be called. It will show up in the visitor log (as an example) as "was viewing revision **10** of page **HomePage**".
This page is a template
Summary:
User name:
Upload a file
By contributing to this wiki, you acknowledge that you waive your right to claim copyright of your individual contributions. The text of this site is uncopyrighted and released to the public domain.
Show markup help Styling **bold **, //italic //, __underline __, --strikethrough--, `teletype ` Headers = Level 1 =, == Level 2 ==, === Level 3 ===, ==== Level 4 ====, ===== Level 5 ===== (ending ='s optional) Lists * Unordered List, # Ordered List, ** Level 2 unordered, ### Level 3 ordered (up to 5 levels, NO SPACES IN FRONT) Links [[Page]], [[Page|description]], [[http://link]], [[http://link|description]] Images {{image.jpg}}, {{right:image.jpg}} (right aligned), [[link|{{image.jpg}}]] (image linked to link), {{image.jpg|alt text}} Extras ---- (horizonal rule), ~~~~ (signature)