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

Retrieves the value of a specified string 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 string value.

## Functional area

Data retrieval

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `getGlobalStringVar name` |

### Arguments

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

### Flags

None

## Return value

string 

> Macro (scroll-pagebreak)

## Examples

```plaintext
Script A
// Define a global variable 
setGlobalVar myVar "ShogunPost 1.11";
 
Script B
// Check to make sure global variable set in Script A still exists
if (`getGlobalVarExists myVar`)
{
   // Use it
   string $progName = `getGlobalStringVar myVar`; 
   print($progName);
}
```

# Additional information

## Related commands

- [delGlobalVar](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736470)
- [getGlobalBooleanVar](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736461)
- [getGlobalFloatVar](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736728)
- [getGlobalIntVar](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738121)
- [getGlobalVarExists](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736894)
- [getGlobalVectorVar](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737705)
- [setGlobalVar](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253739295)