A Command is a simple request to do something. It is designed to give students a way to ask questions, or to create, transform and view objects in an informal, interactive fashion. Users type commands into Mathwright32 Command Fields These commands are single line statements, and they can be either terse, or they may resemble natural language. They are executed when the Enter key is pressed. They may also be part of scripts typed into a TextBox for evaluation using the Enter Command. In this case, the scripts (which can define programs, or commands) may have many lines.
For example, the commands: Graph sin, or Draw the graph of sin have the same effect. In any environment in which commands can be executed (fields, command line, TextBox, or Script window) the user may view the list of all commands currently known to the system, together with a description of their syntax in the Lexicon. Finally, while there is a long list of predefined commands, each with variable syntax, authors may enhance their environments by creating new commands, and these new commands may also have variable syntax. Command Statements always begin with the name of a command (or with optional keywords associated with the command, such as "draw the" that may precede the command name "graph"). These simple commands have two types of "arguments": mandatory arguments, and optional arguments. Mandatory arguments must be supplied in any simple command statement in the order in which they appear in the command definition. Optional arguments may be supplied or omitted, at the user's option, and they may appear in essentially any order. The arguments to commands are forms. If we think of commands as verbs, then the forms are the nouns of the language. Each form has a type, and the type must conform to the type expected by the command. The principal exception to this rule is that if the type expected is string, then any type supplied as argument will be accepted.