Normal Topic Here's a Popup Filer Browser (Read 5206 times)
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Here's a Popup Filer Browser
Oct 30th, 2005 at 12:25am
Print Post Print Post  
Use this to give the user a popup list of files in a certain folder (in this case, jpg and gif images only).  This program assumes you have an LE named 'image'. Once the user selects a file, Sesame can launch the file, delete the file, plug in the filename into an image LE to display an image, etc.

Steve

Command button-On Element Entry:

var a as int
var b as string
var vline as string
var vdata as string
var c as string

a = @shell("dir/b "+ @imagepath() +" > c:\files.txt")
b = @insert("C:\files.txt")

while @len(b) > 0
{
vline = split(b, @newline())
if @right(vline,4) = ".jpg" or @right(vline,4) = ".gif" then
vdata = @appendstringarray(vdata,vline)
}

c = @popupmenu(vdata,"Please select image file")
if c <> "" then.....
« Last Edit: Jan 11th, 2006 at 1:22am by Steve_in_Texas »  
Back to top
IP Logged
 
actiontech
Full Member
***
Offline



Posts: 173
Joined: Apr 10th, 2016
Re: Here's a Popup Filer Browser
Reply #1 - Aug 9th, 2016 at 1:33pm
Print Post Print Post  
Hello, I know this is a very old post, but do you or anyone else care to expound a bit more? I've tried experimenting with this code a bit but haven't gotten good results yet.
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Here's a Popup Filer Browser
Reply #2 - Aug 16th, 2016 at 4:58pm
Print Post Print Post  
I pretty sure the problem is due to the fact that the newer Windows operating systems will deny access the the root folder on the C drive.

Try replacing c:\files.txt with another location like C:\Sesame2\files.txt.

Be sure you have some .jpg or .gif files in the target location. Or, to test, you could comment out the following line:
if @right(vline,4) = ".jpg" or @right(vline,4) = ".gif" then

Commenting that line would list all files and folders in the target location.

You also might find the newer @PopupChoiceList preferable to @PopupMenu.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged