This information is for Vicon Shogun 1.7. For up-to-date help, see the latest Shogun documentation.

Vicon Shogun banner


Use to read a string token from a file. A string token is simply a series of characters, separated by any number of delimiters. For example, the sentence "ShogunPost is for editing" is composed of the tokens "ShogunPost", "is", "for", and "editing", assuming the delimiter is a space. You can " tokenize" the contents of a file for easy parsing.

Note that this command can only be used with text files (files opened without the -b flag). Command will fail if at the end of the file.

Functional area

Disk I/O

Command syntax


readToken fileID [-delims string]


ID of file previously opened with fileOpen


NameFlag argumentsArgument typeExclusive toComments
delims1stringDelimiters to expect between tokens. Default is space, tab, or newline.

Return value



string $token;
int $fileID;
// Open a sample text file
$fileID = `fileOpen "c:/samplefile.txt" "r"`;
// Keep reading in tokens from the file
while( `isEndOfFile $fileID` == false )
$token = `readToken $fileID`;
// Do something with token
print $token;

Additional information

Related commands