RENAME
Renomme un fichier.
Support WebVue - Oui.
Syntaxe
IntVal = RENAME(OldName, NewName);
Type de retour : INTEGER
|
Argument |
Définition |
|
OldName |
Nom courant du fichier. Type STR. |
|
NewName |
Nouveau nom du fichier. Type STR. |
Exécution
|
Retour : |
1 si OK, 0 sinon. |
Le fichier à renommer ne doit pas être ouvert.
Les chemins des fichiers sont relatifs au dossier TP du projet.
Exemple
'Before you run the program, create a file old.txt in the TP folder.
SUB Main()
If (RENAME("old.txt","new.txt")==0) Then
'When the Rename command does not work,
'that is because a file new.txt already exists, so delete it:
If (UNLINK("new.txt")==1) Then
RENAME ("old.txt","new.txt");
Else
'If Rename still does not work, the file may be open:
Print("Check that the new file is not already open.");
End If
End If
END SUB