LB Booster
« Files command »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:46am



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!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Files command  (Read 330 times)
Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx Files command
« Thread started on: Jan 22nd, 2015, 4:15pm »

I really thought there was a way to restrict the scope of the files command that allowed more than one file type. Something like this:
Code:
files path$, "*.txt;*.dat", info$()
 


Am I wrong?

r.m.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Files command
« Reply #1 on: Jan 22nd, 2015, 4:49pm »

on Jan 22nd, 2015, 4:15pm, Alincon wrote:
I really thought there was a way to restrict the scope of the files command that allowed more than one file type. Am I wrong?

You are perhaps thinking of FILEDIALOG, which does indeed allow you to specify multiple extensions in the way you suggest. Unfortunately FILES doesn't.

The capabilities of the two statements are governed by the underlying Windows APIs that they call. FILEDIALOG calls the GetOpenFileName API which allows you to pass a filter like "*.txt;*.doc;*.bak" whereas the FILES statement calls the FindFirstFile API which accepts only an ambiguous filespec like "*.txt".

So, sadly, the only solution to your problem is to call FILES twice and merge the returned arrays (or get FILES to return all the files and do your own filtering afterwards).

Richard.
« Last Edit: Jan 22nd, 2015, 4:52pm by Richard Russell » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls