Capturing file name with explorer

Boaz Bezborodko boaz at mirrotek.com
Tue Nov 26 12:23:26 PST 2013


> Date: Fri, 22 Nov 2013 09:09:47 -0500
> From: Ian Wood<iwood51 at gmail.com>
> Subject: Re: Capturing file name with explorer
> Cc: FP List<Filepro-list at lists.celestial.com>
> Message-ID:
> 	<CAGDrAMd9YPG35NYkDm6WdQDhH9JUFfJy0cYSqeBAQX3G=3Q7zw at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Why use windows explorer at all?  Use filePro's OPENDIR command.
>
> something like this:
>
> ::dim flelst[200](120,*):
> ::declare local bksl(1,allup,g):
> ::declare local dbqt(1,allup,g):
> ::declare local ctr1(3,.0):
> ::declare local ctr2(3,.0):
> ::declare local open_ctr(3,.0):
> ::declare local close_ctr(3,.0):
> ::declare local file_ctr(3,.0):
> ::declare global csv_name(120,*,g):
> ::declare extern dir_name:
> ::declare extern ext_name:
> bldfile:'build the table of .CSV files in the folder::
> ::ctr1="0"; ctr2="1":
> ::dbqt=chr("34"):
> ::open_ctr=opendir("*"{ext_name{"",dir_name):
> zloop:::
> :ctr2 gt open_ctr:goto donez:
> ::ctr1=ctr1+"1":
> ::flelst[ctr1]=@dirlist_name[ctr1]{"."{@dirlist_ext[ctr1]:
> nextz:::
> ::ctr2=ctr2+"1":
> ::goto zloop:
> donez:::
> ::file_ctr=listbox(flelst,"1",ctr1):
> :file_ctr le "0":end:
> ::csv_name=flelst[file_ctr]:
> ::close_ctr=closedir():
> ::end:
>
> I pass the directory name and extension type from the calling routine, but
> you should be able to manipulate this to what you need.

IIRC, OPENDIR has a 32 character limit.  When this is a problem I list 
the contents of the directory to a file and then loop through the file 
with IMPORT or READLN to build the array.

A simple LISTBOX then allows someone to pick from the available files.

Boaz

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com



More information about the Filepro-list mailing list