User Tools

Site Tools


word

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

word [2007/03/02 02:32] (current)
Line 1: Line 1:
 +# $EPIC: word.txt,v 1.4 2007/03/02 02:32:04 jnelson Exp $
 +======Synopsis:​======
 +$__word__(<​index>​ <​list>​)
 +
 +======Technical:​======
 +   * If the <​index>​ argument is omitted, the empty string is returned.
 +   * If the <​list>​ argument is omitted, the empty string is returned.
 +   * The <​index>​ argument is taken as an integer number.
 +   * If <​index>​ is a negative number, the empty string is returned.
 +   * The return value is the <​index>​th word in <​list>,​ counting from zero.
 +   * Remember that <​list>​ is a list of [[what is a word|words]].
 +   * In either case, the returned value is NOT double quoted if it has spaces.
 +   * If <​index>​ is greater than the number of words in <​list>,​ the empty string is returned.
 +
 +======Practical:​======
 +Use this function when you need to extract a specific word from a list.
 +
 +======Returns:​======
 +The <​index>​th word in <​list>,​ counting from zero.
 +
 +======Compatability:​======
 +<​ugh. ​ this is a mess>
 +
 +======Examples:​======
 +<​file>​
 +$word(2 foo bar blah)                  returns blah
 +$word(4 foo bar blah)                  returns the empty string
 +$word(-1 foo bar blah)                 ​returns the empty string
 +xdebug -dword
 +$word(1 one "two three" four five)     ​returns ​        "​two
 +xdebug dword
 +$qword(1 one "two three" four five)    returns ​        two three
 +</​file>​
 +
 +======History:​======
 +This function already existed in ircII.  ​
 +
  
word.txt ยท Last modified: 2007/03/02 02:32 (external edit)