JavaScript Editor js editor     Web development 



Main Page

Returns the current mode of the CAPS LOCK key or sets the CAPS LOCK key mode on or off.

CAPSLOCK([lExpression])

Parameters

lExpression


Include to turn the CAPS LOCK key on or off. CAPSLOCK(.T.) turns CAPS LOCK on and CAPSLOCK(.F.) turns CAPS LOCK off. A logical value is returned corresponding to the CAPS LOCK setting before CAPSLOCK(.T.) or CAPSLOCK(.F.) is issued.

Return Value

Logical

Remarks

Issuing CAPSLOCK(В ) with no argument returns true (.T.) if CAPS LOCK is on, or false (.F.) if CAPS LOCK is off.

Example

The following code stores the state of CAPSLOCK(В ) to a system variable. The = command executes the CAPSLOCK(В ) function to set CAPS LOCK on. Then the = command executes the CAPSLOCK(В ) function to set CAPS LOCK to its previous state.

В Copy Code
glOldLock = CAPSLOCK( )     && Save original setting
CAPSLOCK(.T.)     && Turn CAPS LOCK on

*** Perform any number of statements ***

CAPSLOCK(glOldLock)  && Return to original setting

*** or, toggle CapsLock to the opposite value and back ***

CAPSLOCK(!CAPSLOCK( ))
WAIT WINDOW
CAPSLOCK(!CAPSLOCK( ))
WAIT WINDOW
CAPSLOCK(glOldLock)  && Return to original setting

See Also



JavaScript Editor js editor     Web development