La commande renamefile

byhakim Messages postés 5 Date d'inscription samedi 9 août 2003 Statut Membre Dernière intervention 20 juin 2004 - 19 juin 2004 à 13:44
japee Messages postés 1727 Date d'inscription vendredi 27 décembre 2002 Statut Modérateur Dernière intervention 6 novembre 2021 - 20 juin 2004 à 17:17
bonjour;
quand j'utilise renamefile(fsource,fdestination) ;
fdestination est specifié ..la commande marche.
ex : renamefile('c:\aaa\azerty.txt','c:\aaa\azerty1.txt').

mais quand le fichier source est par exemple:
S; (S: varible string); ca ne marche pas.
ex
S:= 'c:\aaa\'+ edit1.text+'.txt';
renamefile('c:\aaa\azerty.txt',S);

meme si je fait renamefile('c:\aaa\azerty.txt',Pchar(S));

merci

2 réponses

japee Messages postés 1727 Date d'inscription vendredi 27 décembre 2002 Statut Modérateur Dernière intervention 6 novembre 2021 8
19 juin 2004 à 14:32
Attention !

function RenameFile(const AncienNomFichier, NouveauNomFichier: string): Boolean;

Tu as simplement interverti nom d'origine et nouveau nom.

Try again ;)
0
Rejoignez-nous