HP 3000 Manuals

FIND [ HP RPG/XL Utilities-Part 2 RISE ] MPE/iX 5.0 Documentation


HP RPG/XL Utilities-Part 2 RISE

FIND 

FIND locates the first or every occurrence of a string in a work file.

Form 

     F[IND] [E[VERY] ] "string" [IN lb[/le] ]

Parameter Explanation 

E[VERY]          Every occurrence of the string is located in the given
                 range.  (If not specified, only the first occurrence is
                 located.)

"string"         Character or characters you wish to find.  (Note that
                 you may omit "string", and RISE will default and use the
                 previous "string" given with the last FIND command.
                 However, you must specify "string" once.)

IN               Notifies RISE that the next number or character will
                 establish the range of the search for "string".

lb               First or only line designated to be searched.

le               Line where the search ends.

Purpose 

The purpose of the FIND command is to locate the first occurrence of a
string.  If "EVERY" is specified, every occurrence of "string" will be
located in the given range.  If no range is given, RISE will search
starting from the line after the current record pointer through to the
end of the file.  If "EVERY" is omitted, the command will list the first
occurrence within the range.  When you press "F" again, RISE will search
for the next occurrence within the range.  Stepping through each located
line in this manner allows you to review it for any necessary
modifications.  When there is no occurrence of the string, RISE will
print:

     "string" not found

Delimiters:  The delimiters around "string" may be any special character
except the slash (/).

  Execution mode:  Line or Block.

  Record pointer:  At the line containing "string".

Examples 

The following are legal abbreviations which may be used with the FIND
command and its parameters:

FIN "STRING" IN  Search the entire file for the first occurrence of
A                "STRING".  Each subsequent occurrence may be found each
                 time "F" is pressed until all are found.

F "STRING" IN    Find the first occurrences of "STRING" in a line range
10/50            beginning with line 10 and ending with line 50.

F EVERY          Search the entire file for all occurrences of "STRING"
"STRING" IN A    and list them at the terminal.

In the example, the TEXT command is used to copy SIMCAL into a work file,
and lines 1 through 5 are listed (1).  The FIND command is used with the
EVERY parameter to find the string "PUT", and all occurrences of the
string are listed (2).  Next, FIND is again used with EVERY but this time
the string is not specified.  The default string, "PUT", which was used
with the last FIND command, is used again by RISE, and the results are
listed (3).  An error is generated when an abbreviation of FIND cannot be
distinguished from other commands which are similar (4).  Note that "F"
alone is defaulted to FIND, but when "F" is used with a second character,
RISE requires a more thorough identification of the command, and no
default is assumed.

Finally, FIND is used with the string "DISK" in a line range.  The first
occurrence of "DISK" is listed on the screen (5).  When the "F" command
is given, the next occurrence is listed (6).  An execution message
informs the user that all occurrences have been found (7).

          >TEXT SIMCAL
     (1)   Text completed.
          >LIST 1/5
              1     00011H
              SIMCAL
              2     00012FINPUT   IP  F       72               DISK
              3     00013FOUTPUT  O   F       72               DISK
              4     00014IINPUT   AA  01   1  CA
              5     00015I       OR   02   1  CS
          >

     (2)  >FIND EVERY ;PUT; IN ALL
              2     00012FINPUT   IP  F       72               DISK
              3     00013FOUTPUT  O   F       72               DISK
              4     00014IIN`PUT"   AA  01   1  CA
             16     00026OOUTPUT  H 22     1P
          >

     (3)  >F EV IN A
              2     00012FINPUT        IP  F       72           DISK
              3     00013FOUTPUT       O   F       72           DISK
              4     00014IINPUT        AA  01   1  CA
             16     00026OOUTPUT  H 22     1P
          >
          >

     (4)  >FI ;DISK; IN 1/10
             ^
           Error 19: Can't distinguish between FILe, FINd, or FOrm.
          >

     (5)  >F ;DISK; IN 1/10
              2     00012FINPUT   IP  F       72              DISK

     (6)  >F
              3     00013FOUTPUT  O   F       72              DISK

     (7)  >F
           'DISK' not found.
          >
          >



MPE/iX 5.0 Documentation