So struggling with file Types, here's my situation:
I need my app to read(and write) a file - its "just text" but has a specific extension .nka
Whats the best way to set this up to work? I've tried to define a new file type, based upon the common file types but it doesnt seem to work. Will its .Exists is false.
Perhaps I'm over complicating this, all I want to do is open a text file called "config.nka" for reading and writing, whats the simplest way to do this?
Hmm, now I get 0 (zero) error code on this, what am I doing wrong?
Dim InText as FolderItem InText = New FolderItem("config.nka") if InText <> Nil Then if InText.Exists Then MsgBox("got it!!!") Else MsgBox(Str(InText.LastErrorCode)) End if Else MsgBox("fail all over") End if
More searching here reveals
On Windows, when you run from the IDE, the project is built in a new subfolder, so your file won't be next to the program. Try
f = getFolderItem("").Parent.Child("svi.nan")
f = getFolderItem("svi.nan")
..so answered my own question. Thanks anyway..