I'm having some trouble with one of my loops in my MFC program
I'm very much a beginner so go easy on me!
What is happening is that the first for loop checks my exclusions array to test if the data exists, if it does not then it moves to the next loop to check if the data exists there, however on the second loop it seems the nCounter variable never gets incremented, when I watch it in debug it is set at 0 when initialized and then goes to this -858993460, the program only goes two lines down into the loop too
I'm very much a beginner so go easy on me!
What is happening is that the first for loop checks my exclusions array to test if the data exists, if it does not then it moves to the next loop to check if the data exists there, however on the second loop it seems the nCounter variable never gets incremented, when I watch it in debug it is set at 0 when initialized and then goes to this -858993460, the program only goes two lines down into the loop too
Code:
bool flgExclude = false;
for(int nCounter = 0; nCounter < paryExclusions->GetSize(); nCounter++)
{
int nTest = 0;
nTest = strPath.Find(paryExclusions->GetAt(nCounter), 0);
if(nTest != -1)
{
flgExclude = true;
break;
}
}
for(int nCounter = 0; nCounter < paryIncludes->GetSize(); nCounter++)
{
int nTest = 0;
nTest = strPath.Find(paryIncludes->GetAt(nCounter), 0);
if(nTest == -1)
{
flgExclude = true;
break;
}
else
flgExclude = false;
if(!flgExclude)
DeleteFiles(strPath, pLogFile, nMaxAge);
}