Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getfile question
Message
From
01/04/2000 00:11:36
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00353361
Message ID:
00353831
Views:
13
Use the ADIR() function.

Dave


>I'm using the following code to allow users to open a file that is used by my app:
>
>*********************************
>*
>* Method import_data
>*
>*******************************
>
>gcImportST = GETFILE('txt', 'IMPORT FILE', 'Import', 0,;
> 'Select the NSF text file to import')
>gcImportST = ["] + gcImportST + ["]
>
>DO CASE
>
> CASE 'Untitled' $ gcImportST
> =Messagebox(" NSF File Import Cancelled",48, "NSF Notices")
> RETURN
> CASE EMPTY(gcImportST)
> =Messagebox(" NSF File Import Cancelled",48, "NSF Notices")
> RETURN
> CASE gcImportST = ["]+""+["]
> =Messagebox(" NSF File Import Cancelled",48, "NSF Notices")
> RETURN
> CASE right(alltrim(gcImportST),5) <> '.TXT"'
> =Messagebox("ERROR - Import file must be a text file ;
> with a '.txt' extension - please try again", 16, ;
> "NSF Notices")
> RETURN
> OTHERWISE
> gcImportST1 = CHRTRAN((gcImportST), '""', '') thisform.import_data1() && proceed with the import and parsing
>
>ENDCASE
>
>**********
>
>Question: IF a user doesn't select a file - but rather types in a non-existent file name - an error is generated. How should I verify that the filename they typed in (for the users that don't simply select the file) is a file that exists in the app directory.
>
>Thanks.
Previous
Reply
Map
View

Click here to load this message in the networking platform