---
id: "M:cAlgo.API.CommandResult.#ctor(cAlgo.API.ControlBase)"
kind: "constructor"
type: "T:cAlgo.API.CommandResult"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Commands/CommandResult/Constructor/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# CommandResult constructor

Member of [CommandResult](https://help.ctrader.com/ctrader-algo/references/Plugin/Commands/CommandResult/index.md).

## CommandResult(ControlBase child)

Initialises a new instance of the [`CommandResult`](https://help.ctrader.com/ctrader-algo/references/Plugin/Commands/CommandResult/index.md) class.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

C#:

```csharp
public CommandResult(ControlBase child)
```

Python:

```python
CommandResult(child: ControlBase)
```

### Parameters

- `child` (`ControlBase`, Python `ControlBase`): The child control associated with the command result.

### Examples

C#:

```csharp
var textBlock = new TextBlock { Text = "Command completed" };
var commandResult = new CommandResult(textBlock);
Print("Result has content: {0}", commandResult.Child != null);
```

Python:

```python
textBlock = TextBlock()
textBlock.Text = "Command completed"
commandResult = CommandResult(textBlock)
api.Print(f"Result has content: {commandResult.Child is not None}")
```

