Hello, Iris
The folder to run the dir command on is filled by n files with the extention *.xls.
renaming 2 of them to *.xls_ or *.xl produced the described problem.
the following code shows the functions I used.
the function call in the sript window was: > dir_ "X:\MyPath\*.xls" <
StringArray dir(string strFile)
{
WIN32_FIND_DATAA find;
HANDLE hFile;
StringArray adC;
int anzMax;
//out_str(strFile);
//UINT size = adC.GetSize();
//out_int("Groesse Vektor: %i\n",size);
// 1. Durchlauf zum zaehlen der gefundenen Dateien
int nCount = 0;
if((hFile=FindFirstFile(strFile,&find)) != INVALID_HANDLE_VALUE)
{
nCount++;
while(FindNextFile(hFile,&find))
{
nCount++;
}
printf("%d files found\n",nCount);
FindClose(hFile); // must close the hadle
anzMax = nCount;
// 2. Durchlauf zum fuellen des Uebergabevektors
nCount = 0;
adC.SetSize(anzMax);
if((hFile=FindFirstFile(strFile,&find)) != INVALID_HANDLE_VALUE)
{
adC[nCount] = find.cFileName;
nCount++;
while(FindNextFile(hFile,&find))
{
adC[nCount] = find.cFileName;
nCount++;
}
FindClose(hFile); // must close the hadle
}
}
else
{
printf("%s: file(s) not found\n",strFile);
}
adC.Sort();
return adC;
}
void dir_(string strFile)
{
StringArray sa;
sa = dir(strFile);
sa.Sort();
for(int ii=0; ii<sa.GetSize(); ii++)
{
printf("%s\n",GetFileName(sa[ii]));
}
}
Hajo
-- --
Dipl.-Ing. Hans-Joerg Koch
Siemens VDO, Regensburg
SVDO_Origin1 is now hajo 
Edited by - hajo on 03/02/2004 07:38:25 AM