# Class: CommandResult

## CommandResult(status, valueopt)

Result object returned by Command#execute.

## Constructor

#### new CommandResult(status, valueopt)

Constructor.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`status` |  |  |  | status of the command execution
`value` |  | <optional> | null | result of the command execution

Source:
  - control/CommandResult.js, line 42

### Classes

CommandResult

### Members

#### status :number

Get the `status` property of this command result: the status of the command execution.

##### Type:

- number

Source:
  - control/CommandResult.js, line 57
See:
  - COMMAND_RESULT_DONE
  - COMMAND_RESULT_STOPPED
  - COMMAND_RESULT_CANCELED
  - COMMAND_RESULT_FAILED

#### value :string

Get the `value` property of this command result: the result of the command execution. May be `null`, which means: nothing useful.

How to interpret `value` depends on `status`:

`COMMAND_RESULT_DONE`
  The result value, a string, or `null`.
`COMMAND_RESULT_STOPPED` (Remote command only.)
  `null` or a string which normally, after parsing it, should be displayed in a dialog box (e.g. a list of choices letting the user specify what she/he wants).
`COMMAND_RESULT_CANCELED`
  Should be `null`.
`COMMAND_RESULT_FAILED`
  An error message or `null`.

##### Type:

- string

Source:
  - control/CommandResult.js, line 82

### Methods

#### (static) failed()

Convenience method equivalent to returning `new CommandResult(COMMAND_RESULT_FAILED,value)`.

Source:
  - control/CommandResult.js, line 130

#### (static) isDone(result)

Convenience method: tests whether specified result is successful.

##### Parameters:

Name | Type | Description
--- | --- | ---
`result` | CommandResult | result to be tested; may be `null` which is considered to be a non-successful result.

Source:
  - control/CommandResult.js, line 122

#### toString()

Returns a a string representing this result.

Source:
  - control/CommandResult.js, line 89