---
title: "readWord"
canonical: "https://help.vicon.com/space/ShogunPost121/1253736531/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

> Macro (scroll-tablelayout)

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

### Arguments

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

### Flags

None 

## Return value

string

> Macro (scroll-pagebreak)

## 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/ShogunPost121/pages/1253736547)
- [readFloat](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736929)
- [readInt](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736844)
- [readRot](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737158)
- [readString](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736766)
- [readVec](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737170)