---
title: "getGlobalIntVar"
canonical: "https://help.vicon.com/space/Shogun17/13536413/getGlobalIntVar"
format: markdown
---
# Description

Retrieves the value of a specified integer global variable.

Shogun Post's scripting language supports global variables that are accessible across scripts within a session of Shogun Post. This command retrieves the value of a specified global variable (identified by the name argument of the command) which stores a signed 32-bit integer value.

The range of possible values is –2,147,483,648 to 2,147,483,647.

## Functional area

Data retrieval

# Command syntax

## Syntax

|  |
| --- |
| `getGlobalIntVar name` |

### Arguments

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `name` | string | yes | Name of the variable to retrieve |

### Flags

None

## Return value

integer

Returns the integer value stored in the specified global variable. 

> Macro (scroll-pagebreak)

## Examples

```plaintext
// Use the global myVar
integer $localVar = 2; 
print($localVar);
if (`getGlobalVarExists myVar`)
{
  // Override local variable with global integer value 
  $localVar = `getGlobalFloatVar myVar`;
}
print($localVar);
```

# Additional information

## Related commands

- [delGlobalVar](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13536479)
- [getGlobalBooleanVar](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13536357)
- [getGlobalStringVar](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13536425)
- [getGlobalVarExists](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13536423)
- [getGlobalVectorVar](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13536421)
- [setGlobalVar](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13540573)