---
title: "readWord"
canonical: "https://help.vicon.com/space/ShogunPost116/341119268/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/ShogunPost116/pages/341117784) |

### Flags

None 

> Macro (scroll-pagebreak)

## 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;
```

# Additional information

## Related commands

- [readBool](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost116/pages/341119220)
- [readFloat](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost116/pages/341119226)
- [readInt](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost116/pages/341119232)
- [readRot](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost116/pages/341119244)
- [readString](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost116/pages/341119250)
- [readVec](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost116/pages/341119262)