Integer parsing from a char variable?
vegastech
Posts: 369
I have a char string that I want to parse the numeric portion out of. I know the numeric portion starts at character 6 everytime. (I am checking a variable that gets the TP's keypad entry dumped into it, so I know it will always start with KEYP-). The purpose of this is to take the keypad's number entry, place that number into an integer variable, and then execute a timeline. Is this possible with my train of thought, or is there a better way to do this?
0
Comments
Check these forums and the tech notes for examples
TN# 616 is a great example on how to parse buffers. You can use many methods within that basic structure to get the characters and numbers you want. Also try MID_STRING: you can start counting halfway through the string if you want and extract only the number of characters you want.
For anyone interested, here is the string parsing and string to decimal conversion process that worked for me:
Now I can enter minutes into the onboard keypad, and it starts to decrement showing the correct format, based on the following timeline event and formatting:
I feel so accomplished. I couldn't have done this without all of you. Thank you! It's not pretty, but hey, that's what the TPDesign course is for, right?