fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

FIND

Syntax:

FIND ERRORS FIND ERROR [:] <integer> FIND [SYMBOL] [:] <symbol> FIND ASSIGNMENTS [TO] [:] <symbol> FIND WRITES [TO] [:] <symbol>

Note on the Syntax: The keyword SYMBOL may be abbreviated to S. Care must therefore be taken when the optional keyword SYMBOL is omitted. The command f s will be interpreted as FIND SYMBOL and fpt will prompt for the symbol name. It will not immediately seek the symbol S.

Function:

The FIND command is used interactively to locate objects in the code. It finds the first occurrence of the target in the current search scope. The cursor is moved to the target, and the lines at and around the target are displayed. fpt displays w1 lines above the line which contains the target and w2 lines below it, where w1 and w2 are the values set by the WINDOW command. The cursor is indicated by the symbol >> printed to the right of the line number if line numbering is turned on (See NUMBER LINES and LINE NUMBERING).

Scope

The search scope is set by a SET SCOPE, TYPE or SEARCH command. It is a sub-program, a single file, or all files.

Target

The target is an error report or a specified symbol.

  1. Finding Error Reports: To find the first diagnostic marked in the code, use the command:
       FPT> find errors
    To find the first occurrence of a specific error number, specify, e.g.:
       FPT> find error: 1887
  2. Finding Symbols: To find a user-defined symbol, for example, SUMSQ:
       FPT> FIND SYMBOL SUMSQ
    fpt locates the first occurrence of any symbol named SUMSQ. Note that there may be different symbols named SUMSQ in different sub-programs. To find the specific instance of a symbol in a specified sub-program, for example, SUMSQ in the subroutine ANOVA:
       FPT> FIND SYMBOL ANOVA%SUMSQ
    To find the variable SUMSQ in COMMON block OUTCOM:
       FPT> FIND SYMBOL /OUTCOM/SUMSQ
    To find the COMMON block name itself, specify, for example:
       FPT> FIND SYMBOL /OUTCOM/
    The target may be a component of a derived type or a field of a structure. In all cases except that of COMMON blocks the parent-child delimiter in the FIND command is the character %. Please see SPECIFYING A SYMBOL.
  3. Finding Assignments of Symbols: The command, for example:
       FPT> FIND ASSIGNMENTS SUMSQ
    locates the first occurrence of an assignment to the specified target, i.e. the first line on which the target is initialised as DATA, is on the left of an equals sign or occurs as an output argument. Explicit EQUIVALENCE, and implied EQUIVALENCE in a COMMON block are taken into account when the search is made. The symbol sought must therefore be specified unambiguously. If, for example, SUMSQ is used as a local variable in two or more sub-programs, you must specify which SUMSQ is to be sought.

The keyword FIND may be abbreviated to F and the keyword SYMBOL may be abbreviated or ommitted. For example:

   FPT> FIND SYMBOL ANOVA%SUMSQ

may be written:

   FPT> f ANOVA%SUMSQ

The NEXT command is used to find subsequent occurrences of the target.

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

See Also

NEXT

SEARCH

SET SCOPE

TYPE

WINDOW

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