Inspect Manual
High-Level Inspect Commands
Inspect Manual—429164-006
6-210
Examples
Examples
This examples for the SOURCE SEARCH command are based on the source code.
LOCATION FORMAT has been set to LINES, STATEMENTS to display both edit line
and statement numbers.
1. Here are two examples of using SOURCE SEARCH to find a string of text within a
source file.
2. Here are two examples of SOURCE SEARCH which show the effect of the case
clause. When CASE is used, note that the search is restricted. When a string is
not located, Warning 203, “String not found,” will be issued.
3. These three examples illustrate the use of the SOURCE SEARCH command when
specifying position.
-PROGRAM-SOURCE FOR 5 STATEMENTS
*3 #25 val3 = 0x7DF4;
4 #26 val1 = 0;
#27
#28
5 #29 owner_id = (int) val3 >> 16;
6 #30 val2 = proc2(val1, owner_id);
#31
#32 /* test should match first compare. */
7 #33 if ( val2 == 0 )
-PROGRAM-SOURCE SEARCH "owner_id"
#20 int owner_id = 0;
-PROGRAM-SOURCE SEARCH 'owner_id'
#20 int owner_id = 0;
-OBJECT-SOURCE SEARCH 'OWNER_ID'
#PROGRAM int owner_id = 0;
-OBJECT-COMMENT OWNER_ID does not appear in upper-case anywhere
-OBJECT-COMMENT in the source. Warning 203 will be given.
-OBJECT-SOURCE SEARCH 'OWNER_ID' CASE
** Inspect warning 203 ** String not found
-PROGRAM---COMMENT Using the letters F and L.
-PROGRAM-SOURCE SEARCH 'owner_id' F/L
#20 int owner_id = 0;
-PROGRAM---COMMENT Using an edit line number and the letter L.
-PROGRAM-SOURCE SEARCH 'owner_id' #21/L
#29 owner_id = (int) val3 >> 16;
-PROGRAM---COMMENT Using a statement number and an edit line number.
-PROGRAM-SOURCE SEARCH 'owner_id' 3/#33
#29 owner_id = (int) val3 >> 16;