The code below shows how to track the number of characters entered as you enter them in a text field. The On After Keystroke event has to be turned on for the text object where the code below is placed in its object method. As shown, the text is retrieved as it is entered and the length of this text is assigned to a variable.
If (Form event=On After Keystroke )
$enteredText:=Get edited text