...
Code:
S1 = INWSTR(0, sCfg, Quote);
...
Code:
long INWSTR(IN long nIndex, IN WCHAR* MainStr, IN WCHAR* Search) {
long nRet = -1;
long nLength = (long) wcslen(MainStr);
if (nLength && (wcslen(Search))) {
WCHAR* pdest;
if (nIndex > -1) {
pdest = wcsstr(&MainStr[nIndex], Search);
if (pdest) { nRet = long(pdest - &MainStr[0]); }
} else {
nIndex += 1; if (nIndex < 0) { nIndex *= -1; }
reverse(MainStr, nLength);
pdest= wcsstr(&MainStr[nIndex], Search);
if (pdest) { nRet = nLength - long(pdest - &MainStr[0]) - 1; }
reverse(MainStr, nLength);
}
}
return nRet + 1;
}
Die länge des Arrays Search = Quote ist 252 Chars lang sollte er aber nicht.
gruss