' NEWNAME.BAS
' This program lets you rename a data file in the current directory.

CLS

PRINT "The current directory contains the following files:"
PRINT

FILES "*.*"                ' display files in current directory

PRINT                      ' get old and new filenames
INPUT "Which file would you like to rename?  ", oldName$
INPUT "What would you like the new name to be?  ", newName$

NAME oldName$ AS newName$  ' try to rename file

' if oldName$ does not exist or newName$ is an invalid name, the
'   NAME statement will generate a run-time error; otherwise, the
'   following lines will be executed:

PRINT                      ' print success message
PRINT UCASE$(oldName$); " renamed successfully"


