---
title: "readWord"
canonical: "https://help.vicon.com/space/Shogun16/13341410/readWord"
format: markdown
---
# Description

Use to read a word from a file. Command will fail if at the end of the file.

## Functional area

Disk I/O

# Command syntax

## Syntax

|  |
| --- |
| `readWord fileID` |

### Arguments

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `fileID` | int |  | ID of file previously opened with [fileOpen](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13339929) |

### Flags

None

## Return value

string

## Examples

```plaintext
string $str;
int $fileID;
int $fileID = `fileOpen "C:/FileTesting.txt" "r"`;
  
// Now read the string
$str = `readWord $fileID`;
  
// Print out the value
print $str;
fileClose $fileID;
```

> Macro (scroll-pagebreak)

# Additional information

## Related commands

- [readBool](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13341386)
- [readFloat](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13341383)
- [readInt](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13341368)
- [readRot](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13341374)
- [readString](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13341371)
- [readVec](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13341401)