Hi everyone
Using the Sub below, I successfully write the file to the device and am able to read the file when the program opens and load the views with the correct data.
The problem I am having is understanding exactly how this is happening. I was hoping to create a directory named BlankSodoku off the root directory on the device, similar to windows c:/root/blanksodoku.
When I view the directory structures on my PC, I do not see /blanksodoku off the root directory.
My desire is to save the puzzle along with a small config file so the the last puzzle will open when the program opens. This I have also succeeded in doing but only if I place the KNOWN file name at the top of the program.
So what I need is to create the "root/blanksodoku" directory, be able to view all the files in this directory then choose the desired file and open the puzzle.
I have looked at the Files Documentation and tried everything I can think off, but I do not understand how to create the directory and the read the files in that directory.
Any assistance greatly appreciated.
Using the Sub below, I successfully write the file to the device and am able to read the file when the program opens and load the views with the correct data.
The problem I am having is understanding exactly how this is happening. I was hoping to create a directory named BlankSodoku off the root directory on the device, similar to windows c:/root/blanksodoku.
When I view the directory structures on my PC, I do not see /blanksodoku off the root directory.
My desire is to save the puzzle along with a small config file so the the last puzzle will open when the program opens. This I have also succeeded in doing but only if I place the KNOWN file name at the top of the program.
So what I need is to create the "root/blanksodoku" directory, be able to view all the files in this directory then choose the desired file and open the puzzle.
I have looked at the Files Documentation and tried everything I can think off, but I do not understand how to create the directory and the read the files in that directory.
Any assistance greatly appreciated.
B4X:
Sub WriteList(Fiall As String)
Dim List1 As List
List1.Initialize
Dim Temp As String
For I = 0 To 80
List1.Add(l(I).Text)
Temp = sf.Left(l(I).Tag, 1)
List1.Add(Temp)
If Temp = "S" Then
l(I).Enabled = False
l(I).Color = Colors.Red
End If
Next
If File.Exists(File.DirInternal,"/BlankSodoku, " & Fiall &".txt") Then
File.WriteList(File.DirInternal,"/BlankSodoku, " & Fiall & ".txt", List1)
Else
If File.IsDirectory(File.DirInternal,"/BlankSodoku") = False Then File.MakeDir(File.DirInternal,"/BlankSodoku")
File.WriteList(File.DirInternal,"/BlankSodoku, " & Fiall & ".txt", List1)
File.WriteString(File.DirInternal,"/BlankSodoku, Config.txt", Fiall) 'The last puzzle we were compleating.
End If
End Sub