Hey umm try taking a look at your source directory, here's a over bloated function I wrote up, mostly because I am going to have load bulk information soon. Just figured I would get the pro typing out the way. I also figured I could post this in the code base as well as a example.
// Dark GDK - The Game Creators - www.thegamecreators.com
// By: Donny Wilbanks
// Date: 10/18/2010
// ------------------------------------------------------------------------------------------------
// Example of a simpel File Reader for Dark DGK - bare bones
// Enjoy and Modify to your hearts desire.
// ------------------------------------------------------------------------------------------------
#include "DarkGDK.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
// Varibles
char sTextOut[64];
bool bPass = false;
int nFileType = -1;
int nNumberOfEntries = 0;
int nYpos, nXpos;
// turn on sync rate and set maximum rate to 60 fps
dbSetDisplayMode(640,480,32);
dbSyncOn ( );
dbSyncRate ( 60 );
// Clear & Set Varibles
nXpos = 0;nYpos = 16;
strcpy (sTextOut,"");
nNumberOfEntries=0;
// Send Up First File & Directory
dbFindFirst();
dbFindNext(); //because the first one is allways "."
// If you want to get rid of the "source directory" the ".." at slot 0 use another dbFindNext()
// I find it usefull for file detection.
dbFindNext(); // comment this out and see what I am talking about..
// Clear Screen and set Opening
dbCLS();
dbText(0,0,"Generatring List, this will take a few moments...");
dbSync();
// Main System Loop
while ( LoopGDK ( ) || bPass == false)
{
// Loop False Condition - you can happy replace this with your While Loop
if (bPass == false)
{
// Get Currently stored file type from dbFineNext()
nFileType = dbGetFileType();
// If the nFileType does not return a a void (-1) then continue
if (nFileType != -1)
{
// Update Entires
nNumberOfEntries++;
// Display To Screen
dbText(nXpos,nYpos,dbStr(nNumberOfEntries));
dbText(nXpos+16,nYpos,dbGetFileName());
// You can also "copy" the to a string the "dbGetFileName();"
// example: strcpy (sString,dbGetFileName());
// Increase Y position for screen and do a simple check
nYpos+=16; if (nYpos>400) {nYpos = 16; nXpos += 200;};
// Set up next file to read
dbFindNext();
}
else
{
// No More Files, stop reading
bPass = true;
}
}
// End of Pass Give final reading instructions
if (bPass == true)
{
strcpy(sTextOut,"Number of Entries. "); strcat(sTextOut,dbStr(nNumberOfEntries));
dbText(0,416,sTextOut);
dbText(0,432,"<<Press ''Escape'' to Exit>>");
}
// Snyc
dbSync();
}
// return back to windows
return;
}
It works, tells me what's in the directory and gives me a file count back. You may be able to test your code out with this. Good luck to you.
There are many answers but just one question" ~ Jerilith the Mad