FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |


RENAME

Syntax:

RENAME SUB-PROGRAM [:] <old_name> <new_name>

RENAME COMMON [:] <old_name> <new_name>

RENAME [SYMBOL] [:] <old_name> <new_name>

RENAME [SYMBOL] [:] <sub-program_name> \ <old_name> <new_name>

RENAME [SYMBOL] [:] / <COMMON_name> / <old_name> <new_name>

Function:

The specified sub-program, COMMON block or symbol is renamed.

FPT checks that the new name is not a Fortran keyword or an intrinsic function name, and has not been used elsewhere as the name of a user-defined symbol in the same scope. If the name is already in use, an error message is printed and the symbol is not renamed.

The specified user-defined symbol is renamed systematically throughout the code. The renaming is language sensitive. Renaming of a symbol named, for example, WRITE, does not affect the text of the keyword WRITE.

Symbols are specified by name, by COMMON block and name, or by sub-program and name. If two or more symbols match the specification, all are renamed. Symbols with names which contain special characters such as : and @ may be renamed, and in these cases the old name is written as a quoted string (These characters may occur in symbol names under ENCORE MPX Fortran and Salford FTN77 respectively).

If no symbols match the specification an error message is generated.

The command is often used to resolve name clashes reported by the commands CHECK NAMES and SHOW KEYWORDS USED FOR SYMBOLS

Where to use this command:

Operating system command line

Yes


Configuration file, config.fsp

Yes


Specification (FSP) files, *.fsp

Yes


Interactively, to FPT> prompt:

Yes


Interactive command files

Yes


Embedded in the Fortran code

Yes


Example:

The user renames the variable with the same name as the intrinsic function MIN.

FPT> next min
 
Target found at line 45 in file E:\JOHN\FPTTEST\CLOSAP
 
42                   S=S+(P1(J,I)-P2(J,I))*(P1(J,I)-
43              1    P2(J,I))
44        10         CONTINUE
45     >>            MIN=SQRT(S)
46                   IF (MIN .LT. CRITH) RETURN 1
47                ELSE
 
FPT> rename closap\min min_dist
FPT> type
 
42                    S=S+(P1(J,I)-P2(J,I))*(P1(J,I)-
43              1     P2(J,I))
44        10          CONTINUE
45     >>             MIN_DIST=SQRT(S)
46                    IF (MIN_DIST .LT. CRITH) RETURN 1
47                 ELSE

See also:

CHECK NAMES

SHOW KEYWORDS USED FOR SYMBOLS


Copyright ©1995 to 2014 Software Validation Ltd. All rights reserved.