<-- Previous || Up || Next -->

Name As Backup Function
File Operations Class

Public Function NameAsBackup( _
    ByVal vFromFileName As Variant _
    ) As Boolean

Rename a file by replacing the last character of the name with a hyphen ("-").

Example:
    StringToFile("First.", "Debug.Out") = True
    ' Next call renames Debug.Out to Debug.Ou-
    NameAsBackup("Debug.Out") = True
    FileToString("Debug.Ou-") = "First."
See also:
    NameBackupTarget Function
    NameMaybeBackupInTemp Function
vFromFileName: Name of the file that is to be renamed. The file is renamed by changing the last character of its name to a hyphen. Function returns False if vFromFileName is Null or cannot be fixed-up to a String.
Note: If vFromFileName already ends with a hyphen, then the file name is not changed.
Return Value: Function returns True if the file was successfully renamed. Function returns False if the argument cannot be fixed-up or if there is an error renaming the file.
v1.2 BugFix: Changed the argument type from String to Variant to be more consistent with the other functions in this Class.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.