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
Selecting a file to open using the answer function
Moderators: FourthWorld, heatherlaine, Klaus, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Selecting a file to open using the answer function
Hi,
I think you have to use "answer with type" like this :
Best regards
Jean-marc
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||*")
Jean-marc
https://alternatic.ch
Re: Selecting a file to open using the answer function
Thank you! This worked.