SoyEli Active Member Licensed User Longtime User Jun 28, 2011 #1 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:
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:
K kickaha Well-Known Member Licensed User Longtime User Jun 28, 2011 #2 To test if a directory exists use Code: Copy 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 Code: Copy 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
To test if a directory exists use Code: Copy 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 Code: Copy 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.