An application command operates as shorthand for a more complex command. An application command can be created by:
set appcmd <name> <text> [<token=value>*]
where the <text> portion is issued as a command in response to the entry of the <name>. For example, to say "hello, world" when the user types "bigbang":
set appcmd bigbang 'say hello, world' Enter command:>bigbang hello, world
Note the quotes surrounding the command. This is required.
Appcmds are global to the server, and can be created in the startup script. Once created, they can be accessed from the main command window (if any) or from a Telnet command console.
Parameters can be included as token=value pairs. The value is included in the executed command within $name$ brackets.
set appcmd bigbang 'say hello, $where$'
To execute the command, enter the following:
Enter command:>bigbang where=mars hello, mars
You can also add a default value, by including token=value pairs on the definition line:
set appcmd bigbang 'say hello, $where$' where=world Enter command:>bigbang where=mars hello, mars Enter command:>bigbang hello, world
For example:
set appcmd myapp "say read: _sreg(myapp.read,0), indexed _sreg(myapp.indexed,0)" Enter command >myapp read: 15, indexed: 13
set appcmd enc "set property c:/pswds $pswd$ _concat('aes(',_aes('enc',sreg(aeskey),$pswd$),')')" Enter command:>enc pswd=dick The password properties file now contains the first entry #Saved by set command #Wed Jun 02 16:15:20 EDT 2010 dick=aes(gM7ghnyG4DkLaJrs6R/jhQ\=\=)
iWay Software |