I have been searching this for a long time. So, finally I have to make this topic.
I have a value (eg. 123456789). I want to code that if the value starts with numbers 123 then do specific action. I do not know how to do this.
If you want to get a ready-made example, then wait for the responses of others. If you are interested in finding out for yourself, there is a simple algorithm for this:
- Spend time and understand how all the blocks work on the block palette
- when solving the problem, use a dialog with yourself:
-I have a data string. How do I perform an action if it starts with 123?
-To do this, you need to get the first 3 characters from the string and compare them with 123
-How do I do that?
-You need to find a block that can be used to get a substring from a string
-Okay, what if I need the line to start with 12345?
-Then you need to search for a substring depending on its length
-How do I find out the length of a substring?
-To do this, find a block that returns the number of characters in the string passed to it
and so on.
You have described well. I am going to try this NOW!
What about the case in which I want to delete the last 10 characters of a variable length string? For example, “address” is variable in length, but “state, zip, country” are always the same length and I would like chop those off and just show “street, city.” Thank you for any help. And thank you actech for your demos. They are great.