09-26-2016 11:57 AM
The InRange? led is off meaning that the two first values are not in the range defined at index 0 and 1 of the lower limit input and were coerced (you set index 2 to -150 but index 0 and 1 are probably at the default value of 0). Also, the upper limit should be included (right click the function and select include upper limit). The code I posted is unfinished, I only included the limit check for the first block of data.
Ben64
09-26-2016 11:58 AM
Update:
I took the range checking portion off the code and it worked fine, so I guess the error is somewhere in that section. But I am not really sure what that section of code is doing, so I can't really debug it..
Also, is there a way to check if multiple decimal's or negative signs are used? Or if a non-alphabetic character was accidently put in between numbers for an element?
Thanks,
SM
09-26-2016 12:12 PM
09-26-2016 12:14 PM
Jim,
Thanks for the replies. But I would like to parse out any bad data, not just make it 0. If this is possible, which Ben has showed it is.
Thanks,
SM
09-26-2016 12:24 PM
@SteMob wrote:Jim,
Thanks for the replies. But I would like to parse out any bad data, not just make it 0. If this is possible, which Ben has showed it is.
Thanks,
SM
What exactly does that mean? If the data is bad enough, the results aren't going to be good enough to mean anything. It would be like me telling someone "blah blah blah", "Oh well you know what I meant.". You either have good data or bad data, and you are trying to take bad data and guess what the good data is supposed to be. There is no super algorithm that is going to guess what the good data would be when you have an unlimited number of things that could go wrong. Just return a 0 and report that the data is bad.
09-26-2016 12:33 PM
Raven,
Right, I understand that, but I would like to parse out as much as possible, at least for the more common errors like a space or too many negative signs or something. After those have been addressed, then I will just return 0 if some more advanced errors are encountered.
Thanks,
SM
09-26-2016 07:19 PM
Not to beat a dead horse, but you know you could've knocked out that data entry app in less time than it's taking you to figure out this RegEx stuff.
It never hurts to go to your lead with an idea that might make it easier for everyone else. Just be respectfull and don't be a bully about it.
The worst they could so is say somethinbg like, "Well, we can't do it that way because customer requirements say blahblahblah", or something like that, and you at least gain more knowledge about how your little piece fits in with all the others.
09-28-2016 08:11 AM
Bill,
What do you mean by "data entry app"?
Thanks,
SM
09-28-2016 09:27 AM - edited 09-28-2016 09:28 AM
What would be some additional stuff to add to the RegEx or Search And Replace Pattern such that I could parse out any extra decimal place (such as 123...456) or extra negative signs (such as ---123) or extra tilde's (such as [123~~~456~789] )?
Attached is a screen shot of my current code.
Thanks,
SM
09-28-2016 09:32 AM
Way back on the bottom of page three, I uploaded a snippet that contained the seed for a possible data entry application that would eliminate the possibility of command syntax error, but you replied that the powers that be wanted it done the way you had described it, so I didn't push it any further.