FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |




SEARCH ALL FILES [ [ FOR ] [ SYMBOL ] : <symbol> ]

SEARCH FILE: <filename> [ [ FOR ] ERRORS ]

SEARCH FILE: <filename> [ [ FOR ] [ SYMBOL: ] <symbol> ]

SEARCH SUB-PROGRAM: <sub_prog_name> [ [ FOR ] ERRORS ]

SEARCH SUB-PROGRAM: <sub_prog_name> [ [ FOR ] [ SYMBOL: ] <symbol> ]

% SEARCH FOR EXTERNAL PARAMETERS IN [:] <file> [<file> ...]


The SEARCH command is used interactively to change the search scope and to locate objects in the code.


The search scope is a sub-program, a single file, or all files.

If a search scope is specified in a SEARCH or TYPE command, this scope is used by all further SEARCH, FIND, NEXT, TYPE, UP and DOWN commands until it is changed again. If the search scope is specified to be a file, FPT searches that file, and does not search INCLUDE files referenced by it. If the search scope is a sub-program, the search starts at the beginning of the sub-program and all INCLUDE files are searched as they are referenced.


If a target is specified, the SEARCH command locates the first occurrence of the target in the current 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).

The search target may be ERRORS, for example:

FPT> search sub-program anova for errors

The first diagnostic marked in the code is located. The display of multiple occurrences of the same type of diagnostic may be suppressed by the SUPPRESS ERROR command.

The search target may be a user-defined symbol. Symbols are specified by name alone, by sub-program name and local name, or by common block name and local name. A sub-program name is written before the symbol name and is separated from it by a backslash character, for example: ANOVA\SUMSQ. A common block name is written before the local name and is enclosed in forward slashes, for example: /OUTCOM/SUMSQ. FPT locates the first occurrence of a matching symbol in the search scope. Note that a symbol which is specified by sub-program name and local name but which occupies a location in a common block may be found outside the specified sub-program. Note also that the same name may be used for several different objects within a program or even within a single sub-program (for instance, as a common block name, a variable name and a field name). FPT locates the first symbol which matches the target description.

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

The SEARCH FOR EXTERNAL PARAMETERS command is described in a separate manual page. This command does not search the program for a target.

Where to use this command:

Operating system command line


Configuration file, config.fsp


Specification (FSP) files, *.fsp


Interactively, to FPT> prompt:


Interactive command files


Embedded in the Fortran code



FPT> search all files for errors

FPT> search file anova.for for errors

FPT> search sub-program readdat

- Changes the scope but does not search

FPT> s all files for readdat\qsum

- Searches the entire program for the variable qsum defined (presumably in common) in the sub-program readdat

FPT> sear sub-prog anova for /inpdat/

- Searches the sub-program anova for the common block name inpdat

FPT> sear sub-prog outsub for /inpdat/scale

- Searches the sub-program outsub for the variable scale declared in the common block /inpdat/

See also:










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