[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+--------+#################################################################
#+-| RENAME |-----------------------------------------------+#################
#| +--------+ The RENAME command changes the name of a file |#################
#+----------------------------------------------------------+#################
##############################################################################
##############################################################################
#+--| Syntax |-------------------------+######################################
#| RENAME <C-exp1> TO <C-exp2> |######################################
#+-------------------------------------+######################################
##############################################################################
##############################################################################
######+---| Description |---------------------------------------------+#######
######| RENAME <C-exp1> specifies the source filename while <C-exp2> |#######
######| specifies the target filename. RENAME does not allow the DOS |#######
######| wildcard characters '*' and '?' to be part of the filename. |#######
######+---------------------------------------------------------------+#######
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Rename a file in the current directory. |#########
#########| |#########
#########| RENAME "this.fil" TO "that.fil" |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Verify the source file exists prior to |#########
#########| * renaming it. |#########
#########| |#########
#########| IF .NOT. exist( "source.txt" ) |#########
#########| ? "ERROR: Can't rename" |#########
#########| ELSE |#########
#########| RENAME "source.txt" TO "dest.txt" |#########
#########| ENDIF |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 3 |-------------------------------------------+#########
#########| * Rename all .dbf files to .xxx files. |#########
#########| |#########
#########| IF .NOT. find_first( "*.dbf" ) |#########
#########| RETURN |#########
#########| ENDIF |#########
#########| |#########
#########| REPEAT |#########
#########| RENAME find_fstr() TO substr(find_fstr(),1,; |#########
#########| at(".",find_fstr()))+"xxx" |#########
#########| UNTIL .NOT. find_next() |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
DIR
ERASE
exist()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson