---
title: "readWord"
canonical: "https://help.vicon.com/space/Shogun110/13075785/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/Shogun110/pages/13075345) |

### 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/Shogun110/pages/13075769)
- [readFloat](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13075771)
- [readInt](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13075773)
- [readRot](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13075777)
- [readString](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13075779)
- [readVec](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13075783)