Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getfile()
Message
De
24/04/2019 16:29:37
 
 
À
24/04/2019 15:59:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01668266
Message ID:
01668267
Vues:
61
>Hi,
>Is there a way to make getfile() start looking in a by me instantiated directory instead of the default directory?
>Regards,
>Koen

Something like this (untested):
lcFile = my_getfile("c:\default\dir\")

FUNCTION my_getfile
LPARAMETERS tcDefaultDir
LOCAL llError, lcSaveDir, lcFile

    lcSaveDir = FULLPATH(CURDIR())
    IF TYPE("tcDefaultDir") = "C" AND DIRECTORY(tcDefaultDir)
        TRY
            CD (tcDefaultDir)
            llError = .f.
        CATCH
            llError = .t.
        ENDTRY
        IF llError
            MESSAGEBOX("The specified folder does not exist:" + CHR(13) + tcDefaultDir, 0, "GetFile() Error")
            RETURN
        ENDIF
    ENDIF

    * Do the getfile() here
    lcFile = GETFILE(...)

    * Restore original folder
    CD (lcSaveDir)

    * Pass-thru
    RETURN lcFile
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform