Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Renaming File
Message
 
À
23/07/2014 15:07:53
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01604496
Message ID:
01604498
Vues:
62
You can't have [:] in the file name.
BTW why you use ADIR() and FOR loop just for one file?




>Hello comunity
>
>I have this code but they return always the same error:
>
>
>PROCEDURE RENOMEAR
>lnFiles = ADIR(aFiles, "D:\Trabalho_Clientes\Sgate_BD\Myfile.xlsx")
>FOR lnFor = 1 TO lnFiles
>    IF LEFT(aFiles[lnFor, 1], 1) == "."
>       LOOP
>    ENDIF
>    lcSource = "D:\Trabalho_Clientes\Sgate_BD\"+aFiles[lnFor, 1]
>    *lcTarget = "D:\Trabalho_Clientes\Sgate_BD\"+DTOS(aFiles[lnFor, 3]) + aFiles[lnFor, 1]
>    lcTarget = "D:\Trabalho_Clientes\Sgate_BD\"+SUBSTR(TTOC(DATETIME(),3),12)+Dtos(aFiles[m.lnFor, 3]) +CHRTRAN(aFiles[m.lnFor, 4],':','') + aFiles[m.lnFor, 1]
>    RENAME (lcSource) TO (lcTarget)
>NEXT
>ENDPROC
>
>
>Error:
>Line: 343
>Message 1: Invalid path or file name.
>
>But if i write :
>
>
>PROCEDURE RENOMEAR
>lnFiles = ADIR(aFiles, "D:\Trabalho_Clientes\Sgate_BD\Myfile.xlsx")
>FOR lnFor = 1 TO lnFiles
>    IF LEFT(aFiles[lnFor, 1], 1) == "."
>       LOOP
>    ENDIF
>    lcSource = "D:\Trabalho_Clientes\Sgate_BD\"+aFiles[lnFor, 1]
>    *lcTarget = "D:\Trabalho_Clientes\Sgate_BD\"+DTOS(aFiles[lnFor, 3]) + aFiles[lnFor, 1]
>    lcTarget = "D:\Trabalho_Clientes\Sgate_BD\"+Dtos(aFiles[m.lnFor, 3]) +CHRTRAN(aFiles[m.lnFor, 4],':','') + aFiles[m.lnFor, 1]
>    RENAME (lcSource) TO (lcTarget)
>NEXT
>ENDPROC
>
>
>this work fine ??
>What i need is adding the time and minutes and secunds before the date:
>in this moment, the file is rename like that:
>
>20140723192550myfiler.xlsx , where 192550 is the creation date of my file.
>
>How can do that.
>Many thanks
>Luis Santos
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform