Error.item method

The item method retrieves an ErrorItem object from the error queue.

Syntax

retVal = Error.item(
  index
)

Parameters

index [in]

Number (long) containing the index of the ErrorItem object to be retrieved.

Return value

This method returns an ErrorItem object.

Remarks

Windows Media Player can generate a number of errors in response to an error condition. This method allows the retrieval of a specific error in the queue by using an index number. The index numbers for the error queue begin with zero.

You should set Settings.enableErrorDialogs to false if you choose to display custom error messages.

Examples

The following JScript example uses the Error.item object in an event handler to alert the user to the most recent error. The Player object was created with ID = "Player".

<SCRIPT LANGUAGE="JScript"  FOR=Player EVENT=error()>

// Store the most recent error item number.
var max = Player.error.errorCount - 1 

// Store the most recent error in an error item object.
var errItem = Player.error.item(max);

// Use the error item object to store the error info.
errDesc = errItem.errorDescription;
errNum = errItem.errorCode;

// Display the error info.
alert(errNum + "\n" + errDesc);

</SCRIPT> 

Requirements

Version
Windows Media Player version 7.0 or later.
DLL
Wmp.dll

See also

Error Object

ErrorItem Object