Hi,
i have a Text Entry with 20 char place, I need to count the entered words and if the word is less than 20 char for example only 5 char
than word+15char with space like this:
Yesss_______________ (ofcourse _ now is space)
How to do that?
Thanks!
Dudus
TextEntry string count and expand
Moderator: Neosoft Support
Re: TextEntry string count and expand
Dudus:
Try this ...
Try this ...
Code: Select all
... append with spaces to make length of 20 characters
... assumes that string will always be <= 20
... calculate required spaces
StrLen "[TextEntry20]" "[TextEntry20Len]"
Math "20-[TextEntry20Len]" "0" "[RequiredSpaces]"
... make string of required spaces
SetVar "[TwentySpaces]" " "
...SetVar "[TwentySpaces]" "12345678901234567890"
SubStr "[TwentySpaces]" "1" "[RequiredSpaces]" "[RequiredSpacesText]"
... append
SetVar "[RequiredText]" "[TextEntry20][RequiredSpacesText]"
... verify
StrLen "[RequiredText]" "[RequiredTextLen]"
AlertBox "Results" "[TextEntry20Len] ... [RequiredSpaces] ... [RequiredTextLen] ... <[RequiredText]>"
Re: TextEntry string count and expand
Hello Gave!
Works perfect... Thank you verry much!
Dudus
Works perfect... Thank you verry much!
Dudus