When I run the code it will only look for the first name. How can I search for multiple criteria (i.e. multiple names at the same time).
I have been trying options without much success e.g.
xndex = file_find (filehandle, "john"; "sam");
Would anyone be able to point me in the right direction please?
I could search for a single word followed by if statements but without searching for multiple criteria at the same time (i.e. different names) the code is inefficient and very long.
file_seek(filehandle,0,0); xndex = file_find (filehandle, "john"); file_seek(filehandle,0,0); // set the reader back to the beginning of the file xndexi = file_find (filehandle, "sam");
I have a follow-up question having come back to this after some time. If one has a single word for xndex i.e. "john" and a single word for xndexi "sam", then if one is searching for lots of names one will have a lot of xndexs and a lot of code i.e.
The code runs without an error appearing and is less involved. However, if on searches for the two words in a word document (coding for finding the words in a word document has not been included but is in my script) the code says xndex is greater than 0 if the two words are found as well as if they are not. Clearly the code is not working.
My question is... I wonder if there is a way to make xndex represent more than one word?