drr Posted December 27, 2017 Report Share Posted December 27, 2017 I have a Samba sm43-j-r22. I have two questions: 1. Is posible to forbide to the user to insert a string, that contains only spaces chars, in an ASCII String Control? 2. Is there a function to remove spaces of string at the beginning or at the end? Link to comment Share on other sites More sharing options...
Cam Posted December 27, 2017 Report Share Posted December 27, 2017 1) I can't think of a way to do this 2) You 'd have to separate the string in to MI's as separate ASCII characters and then recompile it back together with out the spaces. Link to comment Share on other sites More sharing options...
MVP 2023 Ausman Posted December 27, 2017 MVP 2023 Report Share Posted December 27, 2017 I don't have a Samba to try, but couldn't you use the keypad SB(s) in such a way that spaces entry when a particular screen is on is not accepted? cheers, Aus Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted December 28, 2017 MVP 2023 Report Share Posted December 28, 2017 1) Use the Find String in String function block and search for ASCII 20h (space). Then write logic to make them enter the string again if you find it. 2) The Find function will return a pointer of the space location. You can use the Remove function to get rid of it. You may have to let the functions loop a couple of times to find all instances of a space character. Joe T. 1 Link to comment Share on other sites More sharing options...
drr Posted December 28, 2017 Author Report Share Posted December 28, 2017 Thank you all for yor replies ! I will use find string function to remove spaces at the begining and at the end. Only one more question, is there any SB that goes to ON when the user has finished of input a variable in a control? or is better to detect that the user has touched the ENTER key (SB 53) ? Link to comment Share on other sites More sharing options...
Cam Posted December 28, 2017 Report Share Posted December 28, 2017 Joe's solution is better than mine. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted December 28, 2017 MVP 2023 Report Share Posted December 28, 2017 8 hours ago, drr said: Only one more question, is there any SB that goes to ON when the user has finished of input a variable in a control? Not an SB, but the "Legal entry" field allows an MB that will turn on with a successful entry. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now