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.

if (xndex > 0 && xndexi > 0 && xndexii > 0 etc etc)

I wondered if anyone could help me explain the following?

I have written:

file_seek(filehandle,0,0);
xndex = file_find (filehandle, "john") && file_find (filehandle, "sam");

if (xndex > 0)
..then xyz

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?

Many thanks for your help.