There are three components associated with each command string: the command, the name of the device receiving the command, and the command arguments. A command string has the following form:
command device_name arguments
These components contain the following information:
The command includes a command from the system, required, basic, or extended command set. Examples of commands include open, close, and play.
The device_name designates the target of the command. MCI accepts the names of MCI device types and names of device elements for the device_name. An example of a name of device type is cdaudio. Other device types are listed in the following section.
The arguments specify the flags and parameters used by the command. The flags in the argument consist of the key words supported by the MCI command. Parameters consist of variable numeric or string data which apply to either the MCI command or flag. For example, the play command uses the arguments from position and to position to indicate the positions to start and end playing. (The key words used as flags are indicated by bold font and variables parameters are indicated by the italic font.) You can list the flags used with a command in any order. When you use a flag that has a parameter associated with it, you must supply a value for the parameter.
You can use the following data types for the parameters in a string command:
Strings—String data types are delimited by leading and trailing white space and quotation marks ("). MCI removes single quotation marks from a string. If you want to put a quotation mark in a string, use a set of two quotation marks where you want to embed your quotation mark. If you want to use an empty string, use two quotation marks to delimit the empty string.
Signed long integers—Signed long integer data types are delimited by leading and trailing white space. Unless otherwise specified, integers can be positive or negative. If using negative integers, do not put any white space between the negative sign and the first digit.
Rectangles—Rectangle data types are an ordered list of four signed short values. White space delimits this data type as well as separates each integer in the list.
For example, the following command string instructs the CD audio player “cdaudio” to play the disc sequence located between 5000 milliseconds and 15000 milliseconds from the start of the disc:
play cdaudio from 5000 to 15000
Unspecified command arguments assume a default value. For example, if the flag from was unspecified in the previous example, the CD audio player would start playing at the current position.