Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

Index

On this page

context statement

context

context(%i%)
      

The context statement reproduces the context stored from the rule match, or a single character of it, into the output. Use the context statement as much as possible as it is significantly faster than using the index statement.

A single character from the context can be output (on the right-hand side of a rule) or matched (on the left-hand side of a rule) using context(i), which produces the ith character of the stored context.

Note that although the context(n) statement can be used in the left-hand side of a rule, the context statement cannot.

Example
any(cons) "W" + any(key) > context index(keyout,3)
        
"contex" + "t" > context(2) context(6)     c outputs "ox"
      
Versions

The context(n) construct was introduced in version 6.0.

Related Topics