User Login
Name
Password
Site Contents
News
About
Download
Scripts
Tutorials
Register
Support
FAQ
Script Reference
New User


Contact Me
Xide
Online Scripting Reference

getWordPos

Purpose
Finds the location of a value within a block of text.

Syntax
getWordPos {text} storageVar {subString}

{text}: A block of text to find a value in.

storageVar: A variable to hold the location of the value.

{subString}: The value to find.



Notes
This is a basic text parsing command that will find a value in a block of text. If the value is not found, "storagevar" will be set to "0".

Note that this command is not word specific - you can cut out parts of words or even spaces with it. ANY value within the block of text that matches the value searched for will be found. If there are several matches, only the first one will be returned.

Example
setVar $line "This is a line of text"
getWordPos $line $pos "line"

# displays: 11
echo $pos



Return to item listing