ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Forum AtoutFox : Re: Plannification de tâches   

Sujet

rss Flux RSS des derniers messages

Vous devez vous identifier pour pouvoir poser une question ou répondre.

sam. 14 novembre 2015, 20h12
Jean à Grenoble
atoutfox.public.association

Re: Plannification de tâches

Bonsoir Roland,

essaie d'utiliser LOCFILE() : si le fichier est trouvé, tout va bien; sinon une
fenêtre s'ouvre pour que l'opérateur puisse le rechercher. Il faut alors noter
quel est le répertoire courant pour savoir ce qu'il se passe.

monfichier = LOCFILE("monfichierxml", "XML", "Où est le fichier XML à traiter?")

Locates a file on disk and returns the file name with its path.


LOCFILE(cFileName [, cFileExtensions] [, cFileNameCaption])



Parameters
cFileName
Specifies the name of the file to locate. If cFileName includes only a file
name, LOCFILE( ) searches the Visual FoxPro default directory or folder first.
If the file is not found in the default directory or folder, the Microsoft
Visual FoxPro path is then searched. Use SET PATH to specify the Visual FoxPro path.

If cFileName includes a path and a file name, the specified location is
searched. If the file cannot be found in the specified location, LOCFILE( )
searches the Visual FoxPro default directory or folder and then the Visual
FoxPro path.

If the file is located, LOCFILE( ) returns the file name and path.

cFileExtensions
Specifies file extensions for the file to locate. If the file name you specify
with cFileName does not include an extension, Visual FoxPro applies the file
extensions listed in cFileExtensions to the file name and searches for the file
again.

cFileExtensions also specifies the file name extensions of the files displayed
in the Open dialog box when the file you specified cannot be located.

cFileExtensions can take a variety of forms:

If cFileExtensions contains a single extension (for example, PRG), only files
with that extension are displayed.

cFileExtensions can also contain wildcards (* and ?). All files with extensions
that meet the wildcard criteria are displayed. For example, if cFileExtensions
is ?X?, all files with the extension .fxp, .exe, or .txt are displayed.

In Visual FoxPro for Windows, cFileExtensions can contain a file description
followed by a file extension or a list of file extensions separated with commas.
The file description appears in the Files of Type list box. Separate the file
description from the file extension or list of file extensions with a colon (:).
Separate multiple file descriptions and their file extensions with a semicolon (;).

For example, if cFileExtensions is "Text:TXT" the file description "Text"
appears in the Files of Type list box and all files with a .txt extension are
displayed.

If cFileExtensions is "Tables:DBF; Files:TXT,BAK" the file descriptions "Tables"
and "Files" appear in the Files of Type list box. When "Tables" is chosen from
the Files of Type list box, all files with a .dbf extension are displayed. When
"Files" is chosen from the Files of Type list box, all files with .txt and .bak
extensions are displayed.

cFileNameCaption
Specifies the text you want to use to prompt the user. The text appears to the
left of the textbox in which you enter the file name. If omitted, "File name:"
is displayed.

For a list of Visual FoxPro file extensions and corresponding creator types, see
the File Extensions and File Types online topic.

Collapse imageReturn Value
Character

Collapse imageRemarks
The Open dialog box is displayed if the file cannot be located in the default
directory or folder, the Visual FoxPro path, or a specified location. The Open
dialog box can be used to locate the file. When a file is chosen from the Open
dialog box, the file name is returned with the file's path.

If you exit the Open dialog box by choosing Cancel, pressing ESC, or choosing
Close from the Control menu, Visual FoxPro generates an error message and
LOCFILE( ) does not return a value.

Collapse imageSee Also


Bonne soirée
Jean à Grenoble

Journal

Roland38 pense que ce message est la bonne réponse ou qu'il est utile
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000016873
20 286 messages dans le forum • Liste complète des messages

www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2026.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3