23.01.2012, 15:38
The following code is to check for files that exist:
This code is to check if the file doesn't exist:
EDIT: Am I the only one that posted correct code?
pawn Код:
#define MAX_FILES 1000
......
for(new f=0; f < MAX_FILES; f ++)
{
new fileName[25]; format(fileName, 25, "%d.ini", f);
if(dini_Exists(fileName))
{
//Do something here.
}
else
{
continue;
//OR
break;
//Continue or break is based on your personal preference.
}
}
pawn Код:
#define MAX_FILES 1000
......
for(new f=0; f < MAX_FILES; f ++)
{
new fileName[25]; format(fileName, 25, "%d.ini", f);
if(!dini_Exists(fileName))
{
//Do something here, then call break; to make sure you don't spit out 5000000 files repeatedly.
break;
}
else
{
continue;
}
}