---
title: "assert"
canonical: "https://help.vicon.com/space/ShogunPost121/1253736598/assert"
format: markdown
---
# Description

Provides a runtime test for error conditions. If the test returns true, the assert passes and does nothing. If the test returns false, the script terminates and an assertion failure is reported along with any number of additional arguments supplied to the assert statement after the test.

The additional arguments can be any string or value that can be printed, similar to the [print](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737082) command.

## Functional area

System

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `assert booleanExpression [optionalMessage1] [optionalMessage2] ...` |

### Arguments

> Macro (scroll-tablelayout)

| Name | Type | Required | Comments |
| --- | --- | --- | --- |
| `booleanExpression` | boolean | yes | The condition to check for. If this condition evaluates to false, then the assert will fire and your script will fail. |

### Flags

None

## Return value

void 

> Macro (scroll-pagebreak)

## Examples

```plaintext
int $i; 
// Do something intelligent to set the value of i
$i = 400;
  
// Check to make sure $i was set properly
assert( $i == 400, "i was improperly set to ", $i );
```

# Additional information

## Related commands

- [print](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737082)