Searching for a string within a string
Posted: Wed Sep 15, 2010 9:52 am
Hi
Is there a function in FC 4 (PIC) that would do the same as the visual basic command instr?
Basically instr is used to see if one string exists anywhere within another string. It returns the position where the string is found. If it is not found then it returns 0.
I have attempted in FC to search through a string from the first character in the string and move along each time it fails, I did that by taking a part of the larger string into a temp string and comparing that with the one I was looking for...
I can sort most things out in C but as I am new(ish) to it, it gets time consuming and very frustrating, but will try till I am grey
(Ooopps too late)
My attempt at this with FC just kept locking up the program, got big and messy so stopped and thought of looking for a C solution.
Should I be able to do this with the flowcode components (building blocks) or should I do it in C?
Can we have a FC function to do this in future versions??
Regards
Is there a function in FC 4 (PIC) that would do the same as the visual basic command instr?
Basically instr is used to see if one string exists anywhere within another string. It returns the position where the string is found. If it is not found then it returns 0.
I have attempted in FC to search through a string from the first character in the string and move along each time it fails, I did that by taking a part of the larger string into a temp string and comparing that with the one I was looking for...
I can sort most things out in C but as I am new(ish) to it, it gets time consuming and very frustrating, but will try till I am grey
My attempt at this with FC just kept locking up the program, got big and messy so stopped and thought of looking for a C solution.
Should I be able to do this with the flowcode components (building blocks) or should I do it in C?
Can we have a FC function to do this in future versions??
Regards