Text file list ?

SoyEli

Active Member
Licensed User
Longtime User
Hello :)

Can you HELP

How to test for folder exists.
Load a list of txt files in folder.
and select one ?


Thank you for your help

:sign0085:
 

kickaha

Well-Known Member
Licensed User
Longtime User
To test if a directory exists use
B4X:
File.IsDirectory (Dir, "Name" )
This will return True if a folder called "Name" exists in directory Dir

To load a list of files you can modify this code snippet I use to get all the .html files in my help directory
B4X:
   Dim HelpList As List
   Dim test As String
   
   HelpList = File.ListFiles (File.DirAssets)
   For i = 0 To HelpList.Size-1
      test= HelpList.Get (i)
      If (test.EndsWith  (".html")) Then SpinnerHelp.Add  (test.SubString2 (0,test.Length -5))
   Next

All you need to do is add the names to a list then you can display and select them using an InputList view - or stick with the spinner like I used.
 
Upvote 0
Top