<div style="clear: both;">c = 0;
file[c] = file_find_first("files*.*",fa_archive);
while !(file[c] == ""
{c +=1;
file[c] = file_find_next();
}
file_find_close();
d = 0;
exi_files = "";
while(d<c) {
exi_files += string(d) +". "+file[d]+"#";
d+=1;
}
selected_nr =
get_integer("Choose file by entering the number:#"+exi_files,""
</div>As you can see I got two loops: the first one to find the files, and a second one to arrange them in a list. Although I use the 'while' statement 'for' will do fine as welll. You can specify filetype by changing the mask and the attribute. For an example, if your save file has the extension ".save" it'd be 'file_find_first("files/*.save",fa_archive);' instead.
Notice that although I don't use my array in the presentation, I still got a number presenting it and will need to call it later on, because if the user enters five, then the file he/she wants to load is file[5]...
Your free to use this, although, as always, we would like credits.
Comments
Loading comments...