General information
Category:
Coding, syntax & commands
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only