---
title: "readWord"
canonical: "https://help.vicon.com/space/Shogun114/196389594/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/Shogun114/pages/196387286) |

### 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/Shogun114/pages/196391639)
- [readFloat](https://vicon-help.atlassian.net/wiki/spaces/Shogun114/pages/196393353)
- [readInt](https://vicon-help.atlassian.net/wiki/spaces/Shogun114/pages/196378685)
- [readRot](https://vicon-help.atlassian.net/wiki/spaces/Shogun114/pages/196379676)
- [readString](https://vicon-help.atlassian.net/wiki/spaces/Shogun114/pages/196380432)
- [readVec](https://vicon-help.atlassian.net/wiki/spaces/Shogun114/pages/196385966)