TOPS-20 Commands Reference Manual

KEEP

Protects a fork from being cleared from memory.

Format

@KEEP (FORK) fork

where:

fork is one of the following: Fork name
Fork number
Default - the current fork

Characteristics

Characteristics of Kept Forks

The KEEP command gives a fork a "kept" status. A kept fork has these characteristics:

Inferior Forks

Any inferior forks created by a kept fork are also kept.

Hints

Keeping Forks Automatically

Place SET PROGRAM KEEP commands in your LOGIN.CMD or COMAND.CMD file for programs that you normally place in kept forks. Then when you load the program, the system automatically keeps the fork and notifies you with the message [Keeping FORK-NAME].

The SET PROGRAM command applies only to the current EXEC level. If you want your SET PROGRAM commands to be in effect after a PUSH command, put the commands into your COMAND.CMD file. The COMAND.CMD file is executed automatically after every PUSH command.

Kept Forks Continued Using the Fork Name

The KEEP command sets the fork to be restarted at its starting point when the fork name is given as a command. So, if a program that was kept with the KEEP command is running in a background fork, and you type the kept fork name, execution of the program is canceled and the program returns to its start address, which is usually the program's prompt.

With the SET PROGRAM KEEP command, you to specify the point at which the fork will restart when the fork name is given as a command. The starting point can be the program's continue, reentry, or start address. The command SET PROGRAM KEEP CONTINUE gives the fork name the same function as the CONTINUE /NORMALLY command. So, if a program that was kept with the SET PROGRAM KEEP CONTINUE command is running in a background fork, and you type the kept fork name, execution of the program continues and your terminal is placed at program level.

More Information

The KEEP command is one of the TOPS-20 multiforking-class commands. For more information about multiforking, see the section named, Running Multiple Programs, in the TOPS-20 User's Guide.

Restrictions

Limited Number of Forks

There is a limited number of forks available on a system. When all forks are in use, existing users cannot add forks and new users cannot log in. Therefore, KEEP only necessary forks and return idle forks to the system with the UNKEEP or RESET commands.

Related Commands

INFORMATION FORK-STATUS for displaying the fork status
RESET for clearing forks from memory
UNKEEP for changing a kept fork to an unkept fork
CONTINUE, FORK, FREEZE, INFORMATION PROGRAM-STATUS, SET NAME, and SET PROGRAM other multiforking-class commands
Examples
  1. Display the fork status with the INFORMATION FORK-STATUS command. Then, give the KEEP command to make the current fork a kept fork and redisplay the fork status.
    @INFORMATION FORK-STATUS
     => EDIT (1): HALT at 6254, 0:00:00.5
        FILCOM (2): ^C from IO wait at 700272, 0:00:00.3
    @KEEP
    @INFORMATION FORK-STATUS
     => EDIT (1): Kept, HALT at 6254, 0:00:00.5
        FILCOM (2): ^C from IO wait at 700272, 0:00:00.3
    
  2. Display the fork status, and KEEP the FILCOM fork. Then verify the new fork status.
    @INFORMATION FORK-STATUS
     => EDIT (1): Kept, HALT at 6254, 0:00:00.5
        FILCOM (2): ^C from IO wait at 700272, 0:00:00.3
    @KEEP FILCOM
    @INFORMATION FORK-STATUS
     => EDIT (1): Kept, HALT at 6254, 0:00:00.5
        FILCOM (2): Kept, ^C from IO wait at 776721, 0:00:00.3