I can open a text file that's in a folder, read it's contents, then put that into a text box...
Is there a way to fill a text box with the file names that are in a folder?
If all the files in that folder are text files, is there a way to go through each file, open, read and then load the contents of each into a text box?
Thanks!
Contents of a folder?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
See the RevTalk Dictionary entry for "files" function, which returns a return-delimited list of the contenst of the working directory. You can save the current directory, change it to what you need, get "the files", and change it back, a la:
Code: Select all
function FileList pPath
put the directory into tSaveDir
set the directory to pPath
put the files into tFiles
set the directory to tSaveDir
return tFiles
end FileList
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn