---
name: "saveVar"
type: command
status: ok
groups: ["Variables"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/saveVar
revid: 379372
updated: 2026-10-30T23:57:44Z
---

# saveVar

*Command · Variables · Arma 3 v0.50 · introduced in Operation Flashpoint v1.75*

## Description

Save variable value into the campaign space.
This variable is available to all following missions in the campaign.

## Syntax

```sqf
saveVar varname
```

**Parameters:**

- `varname`: [String](../topics/String.md)

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
saveVar "varOne";
```

## See also

[isNil](../commands/isNil.md) · [missionNamespace](../commands/missionNamespace.md) · [saveStatus](../commands/saveStatus.md)

## Community notes

**Wolfrug** — 2009-01-28

If you try to saveVar a vehicle saved in your variable (SavedVars = [Car1]; saveVar "SavedVars"), then Car1 will not be properly "saved", refering to ObjNull if you try to use it in subsequent missions, even if a vehicle with the same vehicle varname exists. To get around this, save the vehicle's varname as a string (SavedVars = [str(Car1)]) and then when you need it just use call compile to "unstring" the varname (_car = call compile (SavedVars select 0);).

<sub>Source: [BI Community Wiki — saveVar](https://community.bistudio.com/wiki/saveVar) (revision 379372).</sub>
