Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Quick question about WSH
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Quick question about WSH
Divers
Thread ID:
00473563
Message ID:
00473563
Vues:
56
Hi everybody,

I'm in the middle of writting a simple program for renaming all reports in labels in one directory. So far I wrote:
********************************************************************
*  Description.......: RenameReports - rename all existing reports
*  Calling Samples...: 
*  Parameter List....: 
*  Created by........: Nadya Nosonovsky 02/07/2001 02:44:30 PM 
*  Modified by.......: 
********************************************************************
local lnRepFiles, lni, lcOldName, lcNewName, loFSO, loFolder, lcExt
*!*     lnRepFiles=adir(laReports,"*.FR?")
*!*     for lni=1 to lnRepFiles
*!*         lcOldName=laReports[lni,1]
*!*         ?lcOldName
*!*     next    
loFSO=createobject("Scripting.FileSystemObject")
loFolder=loFSO.GetFolder(curdir())
for each oFile in loFolder.Files
     lcOldName=oFile.Name
     lcExt=justext(lcOldName)
     if inlist(lcExt,"LBX","LBT","FRX","FRT") && Report or labels
        lcNewName="XS"+lcOldName
        loFso.MoveFile(
     endif
endfor
I want to keep the same file in the same directory but change the name. Can I use here loFSO.MoveFile(lcOldName,lcNewName)?
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform