indextoword
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | indextoword [2006/08/01 04:13] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | # $EPIC: indextoword.txt, | ||
+ | ======Synopsis: | ||
+ | $__indextoword__(< | ||
+ | |||
+ | ======Technical: | ||
+ | * If the < | ||
+ | * If the < | ||
+ | * If the < | ||
+ | * If the length of < | ||
+ | * Otherwise, the return value returns a value suitable for use with the $word() function (or other word functions) representing the word that contains the < | ||
+ | * Remember that < | ||
+ | * Remember that the return value counts from zero! | ||
+ | |||
+ | ======Practical: | ||
+ | The most obvious application of this function is to find the word on the | ||
+ | input line underneath the cursor. | ||
+ | and $curpos() tells you where the cursor is; you can then use something | ||
+ | like this: | ||
+ | |||
+ | $word($indextoword($curpos() $L) $L) | ||
+ | |||
+ | to extract the word " | ||
+ | mechanics of how tab completion scripts know what to complete. | ||
+ | |||
+ | ======Returns: | ||
+ | A number suitable for use with the word manipulation functions that | ||
+ | represents the word that contains the < | ||
+ | Both < | ||
+ | |||
+ | ======Examples: | ||
+ | < | ||
+ | $word($indextoword($curpos() $L) $L) | ||
+ | @ foo = [one two. three.] | ||
+ | $indextoword($index(. $foo) $foo) returns 1 (the . in ``two.'' | ||
+ | $indextoword($rindex(. $foo) $foo) | ||
+ | $indextoword(100 testing) | ||
+ | </ | ||
indextoword.txt · Last modified: 2006/08/01 04:13 by 127.0.0.1