Counting Characters in a string on the fly
Counting Characters in a string on the fly
(OP)
I have a need to display the number of charchters in a string when a user is enetreing text. Am looking for a way to display the length of the string as each charachter is typed in.
Am sure it must be in an embed somwhere, possibly with an API call perhaps?
Any Ideas how to do this please?
Am sure it must be in an embed somwhere, possibly with an API call perhaps?
Any Ideas how to do this please?
RE: Counting Characters in a string on the fly
you could use timer-event.
In timer-embed you can get LEN() of string and display.
cagiv
RE: Counting Characters in a string on the fly
RE: Counting Characters in a string on the fly
RE: Counting Characters in a string on the fly
From entry control properties check on the immediate check box in extra tab.
then go to the embeds of that control, you will find new event which is (NewSelection). In this event you can put your code.
suppose your entry field is aaa, the the code will be :
CODE
Regards.
RE: Counting Characters in a string on the fly
RE: Counting Characters in a string on the fly
it should work becuase Iam using in in my applications for different cases.
Are you sure you did step 1
(From entry control properties check on the immediate check box in extra tab).
Regards
RE: Counting Characters in a string on the fly
I have a string entry field called GLO:Forecast which e usEr enters the text, and needs to know the character length (which then gets sent out as an eText message.
When I look at the properties, there is no immediate option to select. The only 'immediate' option I can find is the 'Window' propertie, hence only gets updated, I guess, when User complets the field and exits, displays the total character length then.
I take it that you have an 'immediate' option available when looking at your text entry properties ? What kind of field are you using to enter the string? I wonder if it is not available on my global variable and have to use a local proxy?
While cagiv's option works well, your idea sounds better as I am wary that a 'Timer' might cause other problems, slow dows, conflicts etc.
RE: Counting Characters in a string on the fly
Iam using clarion 6.3, any how find the attached file which is an simple application with the source (I think it will be converted when you open it in ver 8.. not sure) but the exe should be running fine to show you the idea.
Regards
RE: Counting Characters in a string on the fly
Helped enormously to track down the issue for me. Basically, did not get an 'immediate' in the properties dialogue, so I 'hard coded' IMM into the widow declaraiotn and have got it working in my app. Thanks a million for your time and effort, much appreciated.
RE: Counting Characters in a string on the fly
Bset Regards
RE: Counting Characters in a string on the fly
Actually me and SalehKiswani are working in the same office and sometimes we use the same PC (actually sometimes I use his PC
So Iam writing again from my account .. you are welcome.
Bset Regards