Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Common dialog and multiselecting files
Message
De
21/06/2007 12:35:08
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
21/06/2007 12:23:34
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01234771
Message ID:
01234775
Vues:
17
>I'm using the common dialog control to allow the user to select multiple files. The resulting selections are stored in the control's FileName property and are separated by a space!.
>
>Now is it me or does this make for extra coding to retrieve the individual files? Imaging this scenario - the user selects a folder with spaces in the name and furthermore, has selected files with spaces in the names.
>
>How do I accurately parse this string to get each filename without having to check each character looking for spaces, periods, etc.?
>
>Here is an example:
>
>C:\Documents and Settings\Mike\My Documents db1.mdb Default.rdp test.zip MY LIST.doc
>
>All help is greatly appreciated.

Wouldn't the files with embedded spaces cause them to be all delimited with quotation marks? In that case you'd just use StrExtract() to parse by quotaition marks.

If everything else fails, chop it at each space, and try to see whether the part to the left of it is a valid filename. If it is, that's one file, and remove it from the list; if it's not, try with next space.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform