Welcome Guest. Please Login or Register. Apr 1st, 2018, 04:38am
ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018. We apologize Conforums does not have any export functions to migrate data. Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.
Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
Re: Listing a directory in a listbox
« Reply #1 on: Nov 21st, 2015, 09:26am »
Richard,
Can this code be modified so that its output goes to an array? And can that array be populated such that each subdirectory in it is followed by its contents?
Great code. Just what I needed at this moment. Thank you.
Can this code be modified so that its output goes to an array?
Well you could code a loop to read the contents of the listbox into an array, either by using the SELECTINDEX and SELECTION? commands or by using the Windows API (LB_GETTEXT message). But wouldn't it be easier to use the FILES statement and simply arrange to pass the same path and filter parameters as you used for the listbox?
Quote:
And can that array be populated such that each subdirectory in it is followed by its contents?
There are examples of recursive use of the FILES statement to recover the contents of sub-directories. A search of the usual LB code repositories should be fruitful.