Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

Other versions
Version 14.0Version 13.0 (current release)Version 12.0Version 11.0Version 10.0Version 9.0Version 8.0 (home page)Version 7.0 (home page)Version 6.0Version 5.0 (home page)Version 4.0 (home page)

On this page

index statement

Description

index(snStore,nOffset)

The index statement gets the offset of the character from the left side of the rule at offset nOffset. The offset refers to the position, including other characters,to the any statement which has saved the offset which it found the character in. The index will output the character at that offset from the store snStore. If usedcarefully, the index and any combination can be very powerful. In previous versionsof Keyman, the index statement was only valid in the output; it can now be used alsoin the context (but not the key section), as long as the source it refers to is beforeit.

snStore: The store to output fromnOffset: The offset in the input to retrieve the any information from.

Examples

any(cons) "W" + any(key) > index(keyout,3) "w" index(cons,1)

History

As of version 6.0, the index() statement can also be used in the left-handside of a rule.