Tech Tip: Real time formating of the input data
PRODUCT: 4D | VERSION: 13.3 | PLATFORM: Mac & Win
Published On: August 16, 2013
Here is a utility method that automatically formats the input data as a user is typing.
The method can be modified to apply any appropriate formats to the input data. In this specific method, the AutoFormat method capitalizes the first character of each word.
// Method: AutoFormat // Description // Format input data while the user is typing // // Parameters // $1 - Pointer to the active variable // // Usage // This method must be called inside the object method // e.g. AutoFormat(Self) // ---------------------------------------------------- C_POINTER($1;$var_p) If (Form event=On After Edit) If (Count parameters>=1) $var_p:=$1 If (Type($var_p->)=Is Text) // TT - http://kb.4d.com/assetid=76284 $var_p->:=UTIL_capitalizeFirst_Regex (Get edited text) End if End if End if |
The method can be modified to apply any appropriate formats to the input data. In this specific method, the AutoFormat method capitalizes the first character of each word.
See Also: