---
url: /flow/guide/scripting-reference/statements/assignment.md
---

# Assignment

## Structure

\<variable> := \<expression>

### Example

::: details Set a variable to a hard-coded value

```pascal
procedure ScriptEvent (var Value : variant);
begin
Value := 10;
end;
```

This example sets the Value parameter equal to 10. In this case the value 10 is hard-coded.
:::

::: details Set a variable to the value of another variable

```pascal
procedure ScriptEvent (var Value : variant);
var MyFloatVariable : double;
begin
MyFloatVariable := 10;
Value := MyFloatVariable
end;
```

This example sets the Value parameter to the value of the MyFloatVariable variable.
:::

::: details Set a variable to the result of a function

```pascal
procedure ScriptEvent (var Value : variant);
begin
Value := TaxAmount(200,12.5)
end;
```

This example sets the Value parameter to the result of the TaxAmount function. Value is therefore set to 25 (200 \* 12.5%).
:::

## Description

Assignment is used to set a variable to a value. The variable to be set is on the left hand side, the value to set it to is on the right hand side.

Assignment is performed using the `:=` operator which is called the [Assignment Operator](/flow/guide/scripting-reference/operators/assignment-operator). Note the colon proceeding the equal sign - it should not be confused with a `=` operator used to compare values (Refer [Relational Operators](/flow/guide/scripting-reference/operators/relational-operators))
