Is there a way to have a number as a command short of putting every number as a verb option like I did in Teleporter Test, so that someone can type:
PAY 3500
or
PAY AGENT 3500
and be able to have any number in the number range?
Right now I'm having the operator calculate amounts due, but if someone was in an auction they might post a bid or for other purposes.
Using a number in a command
Moderators: Ice Cream Jonsey, joltcountry
- Tdarcos
- Posts: 9556
- Joined: Fri May 16, 2008 9:25 am
- Location: Arlington, Virginia
- Contact:
Using a number in a command
"When I die, I want it easy and peaceful in my sleep, like my uncle.
Not screaming and crying like his passengers."
Not screaming and crying like his passengers."
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
You want to use the number grammar token in your verb definition:
verb "pay"
* number DoPay
When DoPay is performed, the object global is set to the number entered.
Your second example command is harder to do, as it's generally impossible to support commands with no separator words between the object and xobject without some trickery, like:
verb "pay"
* "agent" number DoAgentPay
verb "pay"
* number DoPay
When DoPay is performed, the object global is set to the number entered.
Your second example command is harder to do, as it's generally impossible to support commands with no separator words between the object and xobject without some trickery, like:
verb "pay"
* "agent" number DoAgentPay