sendString

sendString(str: String): String;

The sendString method of the MultiMedia class allows commands to be issued directly to the device driver associated with the MultiMedia control. You could perform all of the interfaces to the MultiMedia control by using the appropriate commands, if required. The commands are device-dependent, with each device having its own command set. However, there are common commands that are available with any device.

The sendString command sends the command specified in the str parameter and may return a string containing the reply. An exception is raised if the command is not recognized or is not relevant to the current device. For examples of the commands that are available in a Windows GUI environment, see the "Multimedia Command Strings" section under "Reference", in the Microsoft Developer Network product documentation.

If the useDotNetVersion property is set to true, the sendString method is not available and it generates exception 1068 (Feature not available in this release).

Some examples of commands that are available are listed in the following table.

Command Result
mm.sendString("capability device type") Returns the device type name
mm.sendString("capability has audio") Returns true or false
mm.sendString("delete from 23 to 46") Deletes file data from position 23 through 46
mm.sendString("set audio all off") Disables all audio output
mm.sendString("set file format mpeg") Sets the file format for save calls
mm.sendString("status media present") Returns true or false to indicate if media present

The method in the following example shows the use of the sendString method.

trackLength(track: Integer): Integer;
vars
    str : String;
begin
    str := cd.sendString("status length track " & track.String);
    return str.Integer;
end;