HP 3000 Manuals

END [ EDIT/3000:Reference Manual ] MPE/iX 5.0 Documentation


EDIT/3000:Reference Manual

END 

3-26.  END COMMAND 

3-27.  Purpose. 

The END command is used to terminate EDIT/3000 operation, thus returning
control to MPE/3000, or to end BEGIN/END pairs.  (See Section IV for a
discussion of the END command used in a BEGIN/END pair.)

3-28.  Form. 

The form of the END command is

      E[ND]

3-29.  Description. 

The END command terminates EDIT/3000 operation and returns control to
MPE/3000.  When an END command is entered in an interactive session,
EDIT/3000 will display the message:

     IF IT IS OK TO CLEAR RESPOOND "YES"
     CLEAR.

If the answer is YES (or Y), EDIT/3000 will terminate and MPE/3000 will
display END OF SUBSYSTEM. If the answer is other than YES (or Y),
EDIT/3000 displays the following message

     CLEAR NOT CONFIRMED - TEXT IS UNCHANGED

and prompts for another command.  Both the HOLD and WORK files remain
unchanged.

If the work file is not altered or it if is altered but kept, the message

     IF IT IS OK TO CLEAR RESPOND "YES"
     CLEAR.

does not appear, and EDIT/3000 is terminated without requiring a
response.

In batch mode, the END command is executed unconditionally.

3-30.  Limitations. 

Unless a KEEP command (see paragraph 3-62) is entered before an END
command, the contents of the WORK file will be lost when the END command
is executed.  (The HOLD file is always lost when the END command
executes.)

END in a USE file causes the USE command to terminate (see the
description of the USE command in this section).

3-31.  Example. 

The following examples show the use of the END command.

     /END
     IF IT IS TO CLEAR RESPOND "YES"
     CLEAR? YES

     END OF SUBSYSTEM
     :

If SHORT=TRUE, then the full string, IF IT IS OK TO CLEAR RESPOND "YES,"
is not displayed.

     /SET SHORT;END
     CLEAR? YES

     END OF SYBSYSTEM
     :

3-32.  FIND COMMAND 

3-33.  Purpose. 

The FIND command is used to locate a specific position in the WORK file.

3-34.  Form. 

The form of the FIND command is

            *
F[IND][Q][range]
         [     ]
3-35.  Description. 

The FIND command searches forward in the WORK file from the present
position of the pointer until the range parameter is found.  If range is
a character string, FIND searches forward until the first occurrence of
the string is found.  The pointer is set at the first character of the
string.  If range is a line number, EDIT/3000 moves the pointer to the
first column in that line.  If range is not a single position, but is of
the form startline/stopline, EDIT/3000 will find the first position
specified (startline) or the first existing line before the second
position specified (stopline).  For example, FIND 1/200 will find the
first position of the first line (1) if it exists or of the first
existing line before line 200.  If range is specified as a position in a
line, the pointer is moved to that position.  FIND * finds the current
location of the pointer.  The position of the pointer is always indicated
by EDIT/3000 unless the Q parameter is specified in the FIND command.

3-36.  Limitations. 

If a SET command (see paragraph 3-92) has been used to set left and right
margins in the WORK file, then a search for a string will only operate
within these margins.  For example, if the margins are set with the
command SET LEFT = 50, RIGHT = 72, a FIND command will only locate a
string that occurs totally within columns 50 through 72.

Unless it is desired that the entire contents of the WORK file from the
present position of the pointer to the end of the file be searched, a
FIND command should be entered with a range, as for example,

              FIND "AJAX"/* +10
                      or
              FIND "AJAX"/100

The first of the foregoing commands will search only the 10 lines
immediately following the present location of the pointer, while the
second example will search from the pointer to line 100.

If range is not forward of the present location of the pointer, the
remainder of the file will be searched and range will not be found.  A
FIND FIRST;FIND range command may be used in this case.  The pointer will
return to the first position of the first line in the file and search
from there.

A message will be printed if EDIT/3000 cannot comply with a FIND command,
Reasons for failure include specifying a location or string that does not
exist, specifying a range in the wrong order (last location before first
location), specifying a range behind the current location of the pointer
in the file, specifying a range outside the left or right margins
established by a SET command, and specifying a range consisting of a
string which does not exist.  Note that specifying ALL for the range is
invalid with the FIND command.

3-37.  Examples. 

The following examples illustrate the use of the FIND command.

The FIND FIRST command finds the first line in the WORK file, then
positions the pointer to the first position in this line.

FIND "ENTIRE" finds the string bENTIRE (b signifies a blank character)
and positions the pointer to the first character in this string.

The next command, FIND "HP 3000" results in error message number 21,
"STRING NOT FOUND BEFORE LIMIT" because EDIT/3000 only searches forward 
in the WORK file and HP 3000 occurs before line 8 (the previous location
of the pointer).

The command FIND FIRST;FIND "HP 3000" causes EDIT/3000 to locate the
first line, then the line contain- ing the string HP 3000.  To prevent
EDIT/3000 from listing the first line, the command FINDQ FIRST;FIND "HP
3000" is used.

Finally, the command FIND 8(45) finds the 45th position in line 8.

     /LIST ALL
          1      1-2.  WHAT IS EDIT/3000?
          2
          3      EDIT/3000 IS A SUBSYSTEM OF THE HP 3000
          4      MULTIPROGRAMMING EXECUTIVE OPERATING SYSTEM
          5      (MPE/3000) THAT IS USED TO CREATE AND
          6      MANIPULATE ASCII FILES.
          7
          8      CHARACTERS, STRINGS OF CHARACTERS, OR ENTIRE
          9      LINES OF CHARACTERS CAN BE INSERTED, DELETED,
         10      REPLACED, MODIFIED, SEARCHED FOR, AND OTHERWISE
         11      MANIPULATED BY USING EDIT/3000 COMMANDS.
     /FIND FIRST
          1      1-2.  WHAT IS EDIT/3000?
                 ^ (1  )
     /FIND " ENTIRE"
          8      CHARACTERS, STRINGS OF CHARACTERS, OR ENTIRE
                                               ^ (38 )
     /FIND " HP 3000"
     *21*STRING NOT FOUND BEFORE LIMIT
     /FIND FIRST;FIND " HP 3000"
          1      1-2.  WHAT IS EDIT/3000?
                 ^  (1  )
          3      EDIT/3000 IS A SUBSYSTEM OF THE HP 3000
                                                ^ (32)
     /FINDQ FIRST;FIND " HP 3000"
          3      EDIT/3000 IS A SUBSYSTEM OF THE HP 3000
                                            ^  (32 )
     /FIND 8(45)
          8      CHARACTERS, STRINGS OF CHARACTERS, OR ENTIRE
                                                             ^ (45 )

The next example illustrates that FIND startline/stopline finds the first
existing line (in the WORK file) before the second linenumber specified.

     /DQ 1/7
     NUMBER OF LINES DELETED = 7
     /L ALL
         8        CHARACTERS, STRINGS OF CHARACTERS, OR ENTIRE
         9      LINES OF CHARACTERS CAN BE INSERTED, DELETED
        10      REPLACED, MODIFIED, SEARCHED FOR, AND OTHERWISE
        11      MANIPULATED BY USING EDIT/3000 COMMANDS.
     /FIND 1/10
         8      CHARACTERS, STRINGS OF CHARACTERS, OR ENTIRE
                ^(1 )
     /


MPE/iX 5.0 Documentation