/*------------------------------------------------------------------- xwordpos(word, string, start, char) returns the word position of word in string of char delimited words starting at startword if start is 0 search begins with word 1 if start is > 0 search begins with word number start if worddelim is "" space is used Mark McDonald 2008 -------------------------------------------------------------------*/ int *xwordpos(char *xwrd, char *x, int xsp, char *xdelim){ char *xarray[]; int xret = 0; int nwrds; int xcnt; if(xsp == 0){xsp = 1;} if(xdelim == ""){strcpy(xdelim," ");} nwrds = strparsex(xarray, x, xdelim); if(xsp == 0){xcnt = 0;} if(xsp > 0){xcnt = xsp-1;} while(xcnt < nwrds){ if(xarray[xcnt] == xwrd){xret = xcnt+1; return(xret);} xcnt++; }//wend return(xret); }//xwordpos