Table of Contents

_________________________________________________________________

## NAME

ch_open - create and manipulate a command history object.

## SYNOPSIS

ch_open [chName]

## DESCRIPTION

The ch_open command creates a new command history object (given by the chName argument). The ch_open command returns its chName argument. At the time this command is invoked, there must not exist a command history object named chName.

## METHODS

The ch_open command creates a new Tcl command whose name is chName. This command may be used to invoke various operations on the command history object. It has the following general form:

chName option ?arg arg ...?

Option and the args determine the exact behavior of the command. The following commands are possible for command history objects:

chName add command_string
  Add a command to the history and reset the current command pointer.
chName curr
  Return the current command in the history.
chName history
  Return the entire history.
chName next
  Return the next command in the history making that the current command.
chName prev
  Return the previous command in the history making that the current command.

## EXAMPLE

The following sequence creates a command history object, adds commands and traverses the history.

cwish> ch_open ch
ch
cwish> ch add "cmd1"
cwish> ch add "cmd2"
cwish> ch prev
cmd2
cwish> ch prev
cmd1
cwish> ch curr
cmd1
cwish> ch add "cmd3"
cwish> ch prev
cmd3
cwish> ch prev
cmd2
cwish> ch next
cmd3
cwish> ch next
cwish> ch history
cmd1
cmd2
cmd3

## ACKNOWLEDGEMENTS:

Mark L. Ulferts <mulferts@austin.dsccc.com>

            Basic layout for documenting classes.

Glenn Durfee

            Original implementation of command history in MGED.

## AUTHOR

Robert G. Parker

Table of Contents

- NAME
- SYNOPSIS
- DESCRIPTION
- METHODS
- EXAMPLE
- ACKNOWLEDGEMENTS
- AUTHOR