[SOLVED] character count at runtime
Author: fearandir@gmail.com (fearandir)
Hi all Currently we are developing a SMS messaging tool. We need a "character counter" solution which count the remaining characters until reach 160. Must be at run time, while user is writing. I founded this beauty, but we are under Uniface 9.4. Some workaround? Uniface 9.6.0.4 (Service Pack MX03) + The Edit Box widget now supports incremental searching by means of an onEdit extended trigger that can be used to respond to user input as the user enters data. Thanks, Sergio
4 Comments
Local Administrator
Hi Sergio, This is not really pretty, but it should work:
Instead of doing the calculation in the Start Modification Trigger you also could do it in the <Next Field> trigger (right before the return(-1)). Please note that Uniface will think that the user tries to leave the current field when the macro "^NEXT_FIELD" is executed. So please be "careful" with the code that is executed in the Validation and Leave Field Trigger - maybe you should put the code in the mentioned triggers in an if-clause that is only executed when $SMOD$="F". Just an idea. Hope this helps - and I hope that I did not forget something.
Kind regards, Daniel
Author: diseli (daniel.iseli@uniface.com)
Local Administrator
Thank you Daniel. It works. I hate triggers logic sometimes
Sergio.
Author: fearandir (fearandir@gmail.com)
Local Administrator
Hi Sergio, You are welcome. And glad to hear that it works.
The "wonders" of (the) Uni-verse.
Daniel
Author: diseli (daniel.iseli@uniface.com)
Local Administrator
diseli said
Author: ulrich-merkel (ulrichmerkel@web.de)