By the way, I think I forgot to mention during the last update the additional uses for the inData() command because its more powerful than it looks.
First thing, yes, it can be used to find the position of a character in a string:
1
| inData('I',"IGNITION")->L |
To find the second, third, etc. instance of 'I', you could loop through this.
1
| inData('I',"IGNITION"+L)->L |
This moves the pointer to the spot directly after the last character found so it starts looking at the 'G' until it gets to the end.
Another use for this is to see if a number is part of a specific group. The only problem with this is that 0 is always found at the end since its the terminating character. So you should check for 0 before using the inData() command usually. Another thing to mention is that inData() only works with bytes so make sure you guarantee that your input is restricted to numbers between 0 to 255 or -128 to 127.
1 2 3 4 5 6 7 8 9 10 11 12
| .Inefficient If (A=3 or (A=5) or (A=20) or (A=28) or (A=61)) .Some code End
.Efficient If A If inData(A,Data(3,5,20,28,61,0)) .Some code End End
|
This is probably unnoticeable slower, but its much smaller and the routine is a subroutine so using it more than once in your program will definitely be a large size optimization.