INSMODE( ) Function

Returns the current insert mode, or sets the insert mode on or off.

INSMODE([lExpression])

Return Values

Logical

Parameters

  • lExpression
    Turns the insert mode on or off. INSMODE(.T.) turns the insert mode on and INSMODE(.F.) turns it off. A logical value corresponding to the insert mode setting before INSMODE(.T.) or INSMODE(.F.) was issued is returned.

Remarks

If you omit the optional argument and the insert mode is on (characters are inserted before the cursor), INSMODE( ) returns true (.T.). If the insert mode is off (characters are overwritten at the insertion point), INSMODE( ) returns false (.F.).

Example

The example below uses INSMODE( ) to set the insert mode on, and then toggles the insert mode to the opposite state.

SET TALK ON
=INSMODE(.T.)  && Set insert mode on
? INSMODE( )
= INSMODE(!INSMODE( ))  && Toggle insert mode to opposite state
? INSMODE( )

See Also

CAPSLOCK( ) | NUMLOCK( ) | SET TALK Command