Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Foxpro Command to rename a directory
Message
 
À
10/04/2003 10:15:17
Stephen Hunt
Admit Computer Services Inc.
Farmingdale, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00776036
Message ID:
00776063
Vues:
15
>Is there a foxpro command that will let me rename a directory ?
>
>Thanks for you help
>Stephen J. Hunt

Stephen,

There isn't a FoxPro command, but there are ways to do it within Fox
* FUNCTION RenDir.prg
* AUTHOR: George Tasker
* DATE: July 2, 1998 - 1:38 PM
* PURPOSE: Renames a directory

LPARAMETERS pcoldname, pcnewname

DECLARE SHORT MoveFile IN Win32API;
   STRING @lpcurrentname, STRING @lpnewname
LOCAL lcoldname, lcnewname, llresult
lcoldname = pcoldname
lcnewname = pcnewname
llresult = (MoveFile(@lcoldname, @lcnewname) # 0)
RETURN
However, the Windows Script Host's Scripting.FileSystem object can do the same thing.
oFSO = CREATEOBJECT("Scripting.FileSystemObject")
oFolder = oFSO.GetFolder(< fully qualified name >)
oFolder.Name = lcnewname
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform