This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
Is editing text
|
Is editing text -> Function result | ||||||||
Parameter | Type | Description | ||||||
Function result | Boolean |
![]() |
True if text is being entered, False otherwise | |||||
The Is editing text command returns True if the user is entering values in an input form object, and False in all other cases.
This command is designed to distinguish, within code triggered by the On Before Keystroke form event in a listbox (enterable and non-enterable), between actual user data entry and use of shortcut keys. You might want to execute a different code whether the user is pressing a key to enter text in a cell or to scroll the listbox, for example to implement a type-ahead feature.
Notes:
You want to allow the user to select a row beginning with the typed letter or number in an enterable listbox:
Case of
:(FORM Event.code=On Before Keystroke) //a key is pressed
If(Is editing text) //text is entered
// you disallow some characters
If(Keystroke="+")|(Keystroke="-")|(Keystroke="/")|(Keystroke="*")
FILTER KEYSTROKE("")
End if
Else
//nothing is beeing entered, scrolling shortcut feature
$charCode:=Keystroke
$char:=Uppercase($charCode) // removes accents
Case of
:((($char>="A")&($char<="Z"))|(($char>="0")&($char<="9")))
... //Select a row beginning with the typed letter or number
:($charCode>=Left arrow key)&($charCode<=Down arrow key) // left/right/up/down arrows
FILTER KEYSTROKE("") // disable actions of arrows
End case
End if
End case
FILTER KEYSTROKE
Get edited text
Type ahead made easy (blog post)
Product: 4D
Theme: Entry Control
Number:
1744
Created: 4D v18 R5
4D Language Reference ( 4D v20 R7)