Mail Archives: djgpp/1998/03/24/03:41:16
>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
- Raw text -