From: G DOT DegliEsposti AT ads DOT it To: "Helix" cc: djgpp AT delorie DOT com Message-ID: Date: Tue, 24 Mar 1998 09:35:45 +0100 Subject: Re: The for_each_file function, HELP!!! Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Precedence: bulk >I've been writting my code and I've reached another stump. What I need is a >function which displays all the files in the current directory with the >extention "map", something like "World.map". It would also be nice if the >user could select the file and load it up. I think I've found a function in >the allegro libraries, named (for_each_file) but I don't understand the >last two arguments of the function, it's attrib and a param. My Callback I haven't got the Allegro docs here so my reply is based on memory only: attrib should be a set of flag FA_* for matching files not only with filenames but also with attributes. (Have a look at libc docs 'findfirst' for more info) param is an optional argument which gets passed to your callback function for every call. >for_each_file("*.map", NULL, callback(), NULL); Here you have to specify a pointer to "callback" function! remove the "()" because this way you are making a call to it! >callback() >{ > int d=0; > d=d+15; > > textout(screen, font, "Does exits", 272+d, 147, 104); >} ciao Giacomo