fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

SELECT SYMBOL

Syntax:

SELECT [SYMBOL] [:] <identifier> SELECT [SYMBOL] [:] <identifier> { % <identifier> } SELECT [SYMBOL] [:] /<common_name>/ SELECT [SYMBOL] [:] /<common_name>/ <identifier>

Function:

fpt lists all symbols which match the specification. Note that the % character is used universally as the parent-child separator. Therefore the variable i in the subroutine s is referenced as s%i. Similarly, the field y in the structure cart is referenced as cart%y even though the field separator for stuctures is the dot, '.'.

The selected symbols may then be found in the code by the find and next commands.

Where to Use this Command

Operating system command line No
Configuration file, config.fsp No
Specification (fsp) files, *.fsp No
Interactively, to FPT> prompt Yes
Interactive command files Yes
Embedded in the Fortran code No

Example

fpt is run interactively on the trivial program:

PROGRAM t CALL s(i) WRITE(*,*)i END PROGRAM t SUBROUTINE s(i) READ(*,*)i END SUBROUTINE s

The SELECT SYMBOL, FIND and NEXT commands show (Note that the commands may be abbreviated):

FPT> select symbol i Name Scope Use/COMMON Address Type Size Value/Bounds ---- ----- ---------- ------- ---- ---- ------------ i s FORMAL OUTPUT ARGUMENT INTEGER *4 df i t LOCAL INTEGER *4 df 2 symbols selected FPT> find Target found at line: 2 in file: /home/john/projects/WinFPT/fpt/fpttest/t.f90 1 PROGRAM t 2 >> CALL s(i) 3 WRITE (*,*)i 4 END PROGRAM t 5 SUBROUTINE s(i) 6 READ (*,*)i FPT> next Target found at line: 3 in file: /home/john/projects/WinFPT/fpt/fpttest/t.f90 1 PROGRAM t 2 CALL s(i) 3 >> WRITE (*,*)i 4 END PROGRAM t 5 SUBROUTINE s(i) 6 READ (*,*)i 7 END SUBROUTINE s ****** <EOF> ****** FPT> n Target found at line: 5 in file: /home/john/projects/WinFPT/fpt/fpttest/t.f90 1 PROGRAM t 2 CALL s(i) 3 WRITE (*,*)i 4 END PROGRAM t 5 >>SUBROUTINE s(i) 6 READ (*,*)i 7 END SUBROUTINE s ****** <EOF> ****** FPT> n Target found at line: 6 in file: /home/john/projects/WinFPT/fpt/fpttest/t.f90 2 CALL s(i) 3 WRITE (*,*)i 4 END PROGRAM t 5 SUBROUTINE s(i) 6 >> READ (*,*)i 7 END SUBROUTINE s ****** <EOF> ****** FPT> FPT> FPT> select sym t%i Name Scope Use/COMMON Address Type Size Value/Bounds ---- ----- ---------- ------- ---- ---- ------------ i t LOCAL INTEGER *4 df 1 symbol selected FPT> f Target found at line: 2 in file: /home/john/projects/WinFPT/fpt/fpttest/t.f90 1 PROGRAM t 2 >> CALL s(i) 3 WRITE (*,*)i 4 END PROGRAM t 5 SUBROUTINE s(i) 6 READ (*,*)i FPT> n Target found at line: 3 in file: /home/john/projects/WinFPT/fpt/fpttest/t.f90 1 PROGRAM t 2 CALL s(i) 3 >> WRITE (*,*)i 4 END PROGRAM t 5 SUBROUTINE s(i) 6 READ (*,*)i 7 END SUBROUTINE s ****** <EOF> ****** FPT> n NEXT/FIND/SEARCH - Target not found. FPT>

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