Loading an external file by selection

BlitzMax Forums/BlitzMax Beginners Area/Loading an external file by selection

Ryan Burnside(Posted 2007) [#1]
I don't have max GUI but I want to make a game where the player can load a single text file from the main folder that the game is in. I was thinking about making a button class and then make one instance of a button for each file in the main game folder. How could this or something similar be done? Basically the player just needs to see the files available and select one for loading.


impixi(Posted 2007) [#2]
There's a RequestFile function in the System module. Perhaps that is what you need?

filter$="Text Files:txt;All Files:*"
filename$=RequestFile( "Select file to open",filter$,False, AppDir)

Print filename



Ryan Burnside(Posted 2007) [#3]
Ah great thanks. I had overlooked that function.