Q: Using a configurationfile in the application directory
The configfile "musicman.cfg" is in the application directory, but each time I run the program, user is asked to create a new file.
Sean Soole; email@example.com
A: try this code... You have to changed it if you want your user to name a new configuration file. Private Sub Command1_Click() Dim ConfigFile$ Dim res Dim nFile% Dim vDummy$ ConfigFile = App.Path & "\musicman.cfg" res = Dir(ConfigFile) If res = "" Then MsgBox "didn't found anything" 'making a new one nFile% = FreeFile Open ConfigFile For Output As #nFile% Print #nFile, "testing" Close #nFile Else MsgBox "opening " & ConfigFile 'open existing one nFile% = FreeFile Open ConfigFile For Input As #nFile% Input #nFile, vDummy MsgBox vDummy Close #nFile End If End Sub Return