This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v19.8
Is editing text

Is editing text 


 

Is editing text -> Function result 
Parameter Type   Description
Function result  Boolean in 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: 

  • The Is editing text command always returns True with input and combo box objects. 
  • The Is editing text command always returns False with all other objects, in particular 4D Write Pro and 4D View Pro areas.

Example  

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



See also 

FILTER KEYSTROKE
Get edited text

 
PROPERTIES 

Product: 4D
Theme: Entry Control
Number: 1744

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v18 R5

 
ARTICLE USAGE

4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)
4D Language Reference ( 4D v19.4)
4D Language Reference ( 4D v19.5)
4D Language Reference ( 4D v19.6)
4D Language Reference ( 4D v19.7)
4D Language Reference ( 4D v19.8)