Maybe you can set addpath:=0 to get only the name of the files and not the full path, since you have the path in filepath$ to begin with.
I also tested and found the resulting string variable can hold much more then 8191 characters. I don't have a folder with more files, but here is what I found using a folder with Origin source code:
string results$;
string sPath$="D:\dev\Source\vc32\OKern96\";
findFiles path:=sPath$ ext:="*.*" addpath:=1 fname:=results$;
results.GetLength()=;
int nn = results.GetNumTokens(CRLF);
nn=;
I got the following print out
quote:
results.GetLength()=33590
nn=781
So 781 files with full path taking up 33590 bytes and I don't see a crash. I did not try this in 9.1 though.
CP