Selecting a file to open using the answer function

Want to move your code and projects to LiveCode but don't know where to start?

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller

Post Reply
drhoward
Posts: 22
Joined: Tue Dec 10, 2013 9:03 am

Selecting a file to open using the answer function

Post by drhoward »

I'm working on a program that reads a csv file and am using the answer file function. The function has a parameter to specify the file type. However, when I get to the directory containing my file, all of the files are displayed, not just the csv files. I've tried various ways of entering the parameter; with a period as in .csv, without the period as in csv, with and without quotes, etc. Can someone please make a suggestion as to the correct syntax to use?

Here is a sample of the code that I've been using:

answer file "Select the text file to read" with type "csv"

Thanks
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2734
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Selecting a file to open using the answer function

Post by jmburnod »

Hi,
I think you have to use "answer with type" like this :

Code: Select all

 answer file "Select an image" with type ("JPEG files|jpg,jpeg|JPEG,JFIF" & return & "Any file||*")
Best regards
Jean-marc
https://alternatic.ch
drhoward
Posts: 22
Joined: Tue Dec 10, 2013 9:03 am

Re: Selecting a file to open using the answer function

Post by drhoward »

Thank you! This worked.
Post Reply